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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CoordinatesDatacreateCoordinates(GlobalSuggestionData locationSourceEntry) Creates coordinates data.protected TravelLocationDatacreateLocation(GlobalSuggestionData locationSourceEntry) Creates the single location from the keys in the entrySet of the map.protected PositionDatacreatePositionData(GlobalSuggestionData locationSourceEntry) Creates a PositionData from the keys of the map.protected List<TravelLocationData>createSubLocations(List<GlobalSuggestionData> locationsSourceEntry) Creates the sub locations list from the value of each entrySet of the map.protected booleanhasCoordinates(GlobalSuggestionData locationSourceEntry) Check if the given location has coordinatesvoidpopulate(Map<GlobalSuggestionData, List<GlobalSuggestionData>> source, TravelLocationSuggestionData target) Converts the Map<GlobalSuggestionData, List> in 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.ConversionExceptionConverts 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:
populatein interfacede.hybris.platform.converters.Populator<Map<GlobalSuggestionData,List<GlobalSuggestionData>>, TravelLocationSuggestionData> - Parameters:
source- the map of locations - list of sub locationstarget- 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
Creates the single location from the keys in the entrySet of the map.- Parameters:
locationSourceEntry- the location source entry- Returns:
- the TravelLocationData
-
createPositionData
Creates a PositionData from the keys of the map.- Parameters:
locationSourceEntry- the location source entry- Returns:
- the PositionData
-
hasCoordinates
Check if the given location has coordinates- Parameters:
locationSourceEntry- the locationSourceEntry- Returns:
- true if there are coordinates
-
createCoordinates
Creates coordinates data.- Parameters:
locationSourceEntry- the location source entry- Returns:
- the coordinates data
-