Class DefaultTravelLocationSuggestionPopulator

java.lang.Object
de.hybris.platform.travelfacades.search.converters.populator.DefaultTravelLocationSuggestionPopulator
All Implemented Interfaces:
de.hybris.platform.converters.Populator<Map<GlobalSuggestionData,List<GlobalSuggestionData>>,TravelLocationSuggestionData>

public class DefaultTravelLocationSuggestionPopulator extends Object implements de.hybris.platform.converters.Populator<Map<GlobalSuggestionData,List<GlobalSuggestionData>>,TravelLocationSuggestionData>
Populator class for TravelLocationSuggestionData.
  • Constructor Details

    • DefaultTravelLocationSuggestionPopulator

      public DefaultTravelLocationSuggestionPopulator()
  • Method Details

    • populate

      public void populate(Map<GlobalSuggestionData,List<GlobalSuggestionData>> source, TravelLocationSuggestionData target) throws de.hybris.platform.servicelayer.dto.converter.ConversionException
      Converts the Map<GlobalSuggestionData, List> in TravelLocationSuggestionData. The key of the map corresponds to the single location in the TravelLocationsData and the value of the map corresponds to the list of sub locations in the TravelLocationsData. The list of locations are the keySet of the map.
      Specified by:
      populate in interface de.hybris.platform.converters.Populator<Map<GlobalSuggestionData,List<GlobalSuggestionData>>,TravelLocationSuggestionData>
      Parameters:
      source - the map of locations - list of sub locations
      target - the Data target
      Throws:
      de.hybris.platform.servicelayer.dto.converter.ConversionException
    • createSubLocations

      protected List<TravelLocationData> createSubLocations(List<GlobalSuggestionData> locationsSourceEntry)
      Creates the sub locations list from the value of each entrySet of the map.
      Parameters:
      locationsSourceEntry - the locations source entry map
      Returns:
      the list of TravelLocationData sub locations
    • createLocation

      protected TravelLocationData createLocation(GlobalSuggestionData locationSourceEntry)
      Creates the single location from the keys in the entrySet of the map.
      Parameters:
      locationSourceEntry - the location source entry
      Returns:
      the TravelLocationData
    • createPositionData

      protected PositionData createPositionData(GlobalSuggestionData locationSourceEntry)
      Creates a PositionData from the keys of the map.
      Parameters:
      locationSourceEntry - the location source entry
      Returns:
      the PositionData
    • hasCoordinates

      protected boolean hasCoordinates(GlobalSuggestionData locationSourceEntry)
      Check if the given location has coordinates
      Parameters:
      locationSourceEntry - the locationSourceEntry
      Returns:
      true if there are coordinates
    • createCoordinates

      protected CoordinatesData createCoordinates(GlobalSuggestionData locationSourceEntry)
      Creates coordinates data.
      Parameters:
      locationSourceEntry - the location source entry
      Returns:
      the coordinates data