Class ShoppingRuleUtils

java.lang.Object
de.hybris.platform.shoppingrulesengine.utils.ShoppingRuleUtils

public class ShoppingRuleUtils extends Object
Utils for shopping rule extension
  • Method Details

    • getOriginData

      public static TransportFacilityData getOriginData(List<TransportOfferingData> transportOfferings)
      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

      public static ZonedDateTime getUtcZonedDateTime(Date date, ZoneId zoneId)
      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 ZonedDateTime
      zoneId - the zoneId of the date
      Returns:
      the ZonedDateTime with the UTC time-zone.
    • getZonedDateTime

      public static ZonedDateTime getZonedDateTime(Date date, ZoneId zoneId)
      Method to get the ZonedDateTime object from a date and its zoneId.
      Parameters:
      date - the date to be converted in a ZonedDateTime
      zoneId - the zoneId of the date
      Returns:
      the ZonedDateTime calculated from the date and its zoneId.