Class ShoppingRuleUtils
java.lang.Object
de.hybris.platform.shoppingrulesengine.utils.ShoppingRuleUtils
Utils for shopping rule extension
-
Method Summary
Modifier and TypeMethodDescriptionstatic TransportFacilityDatagetDestinationData(List<TransportOfferingData> transportOfferings) Gets the destination from a sorted list of transport offerings.static TransportFacilityModelgetDestinationModel(List<TransportOfferingModel> transportOfferings) Gets the destination from a sorted list of transport offerings.static TransportFacilityDatagetOriginData(List<TransportOfferingData> transportOfferings) Gets the origin from a sorted list of transport offerings.static TransportFacilityModelgetOriginModel(List<TransportOfferingModel> transportOfferings) Gets the origin from a sorted list of transport offerings.static ZonedDateTimegetUTCDepartureTimeFromTransportOfferingData(TransportOfferingData transportOfferingData) Gets utc departure time.static ZonedDateTimegetUTCDepartureTimeFromTransportOfferingModel(TransportOfferingModel transportOfferingModel) Return the UTC departure time for the given transportOfferingstatic ZonedDateTimegetUtcZonedDateTime(Date date, ZoneId zoneId) Method to get the ZoneDateTime with the UTC time-zone given a Date and its ZoneId.static ZonedDateTimegetZonedDateTime(Date date, ZoneId zoneId) Method to get the ZonedDateTime object from a date and its zoneId.
-
Method Details
-
getOriginData
Gets the origin from a sorted list of transport offerings.- Parameters:
transportOfferings- a list of transport offerings data- Returns:
- the origin location
-
getDestinationData
public static TransportFacilityData getDestinationData(List<TransportOfferingData> transportOfferings) Gets the destination from a sorted list of transport offerings.- Parameters:
transportOfferings- a list of transport offerings data- Returns:
- the destination location
-
getUTCDepartureTimeFromTransportOfferingData
public static ZonedDateTime getUTCDepartureTimeFromTransportOfferingData(TransportOfferingData transportOfferingData) Gets utc departure time.- Parameters:
transportOfferingData- the transport offering data- Returns:
- the utc departure time
-
getOriginModel
public static TransportFacilityModel getOriginModel(List<TransportOfferingModel> transportOfferings) Gets the origin from a sorted list of transport offerings.- Parameters:
transportOfferings- a list of transport offerings- Returns:
- the origin location
-
getDestinationModel
public static TransportFacilityModel getDestinationModel(List<TransportOfferingModel> transportOfferings) Gets the destination from a sorted list of transport offerings.- Parameters:
transportOfferings- a list of transport offerings- Returns:
- the destination location
-
getUTCDepartureTimeFromTransportOfferingModel
public static ZonedDateTime getUTCDepartureTimeFromTransportOfferingModel(TransportOfferingModel transportOfferingModel) Return the UTC departure time for the given transportOffering- Parameters:
transportOfferingModel- as the tranportOffering- Returns:
- the zoned date time
-
getUtcZonedDateTime
Method to get the ZoneDateTime with the UTC time-zone given a Date and its ZoneId.- Parameters:
date- the date to be converted in the UTC ZonedDateTimezoneId- the zoneId of the date- Returns:
- the ZonedDateTime with the UTC time-zone.
-
getZonedDateTime
Method to get the ZonedDateTime object from a date and its zoneId.- Parameters:
date- the date to be converted in a ZonedDateTimezoneId- the zoneId of the date- Returns:
- the ZonedDateTime calculated from the date and its zoneId.
-