Class TravelRuleUtils

java.lang.Object
de.hybris.platform.travelrulesengine.utils.TravelRuleUtils

public class TravelRuleUtils extends Object
Utility funcitons to help evaluating some rule related functions.
  • Field Details

  • Method Details

    • getDaysBetweenDates

      public static long getDaysBetweenDates(Date startDate, Date endDate)
      Method to find the difference in days between two dates
      Parameters:
      startDate - the start date
      endDate - the end date
      Returns:
      days between dates
    • isDateBetweenDates

      public static boolean isDateBetweenDates(Date date, String startDate, String endDate)
      Method to find if the input date is between start and end dates
      Parameters:
      date - the date
      startDate - the start date
      endDate - the end date
      Returns:
      boolean
    • isDateAWeekend

      public static boolean isDateAWeekend(Date date)
      Method to find if the given date falls on weekend
      Parameters:
      date - the date
      Returns:
      boolean
    • getHour

      public static long getHour(Date date)
      Gets hour.
      Parameters:
      date - the date
      Returns:
      the hour
    • setDateToMidnight

      public static Date setDateToMidnight(Date date)
      Set date to midnight.
      Parameters:
      date - the date
      Returns:
      the date
    • getDepartureDate

      public static Date getDepartureDate(List<TransportOfferingRAO> transportOfferings)
      Gets departure date.
      Parameters:
      transportOfferings - the transport offerings
      Returns:
      the departure date