Class Utilities


  • public final class Utilities
    extends java.lang.Object
    Class of utilities
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.time.LocalDate getClosestDateInPast​(java.util.List<java.time.LocalDate> listDate, java.time.LocalDate dateToSearch)
      Return the closest date in past a list of date with the given date
      static java.time.LocalDateTime getClosestDateTimeInFuture​(java.util.List<java.time.LocalDateTime> listDateTime, java.time.LocalDateTime dateTimeToSearch)
      Return the closest date time in future in a list of date time and a given date time
      static WeekDefinition getClosestWeekDefinitionInPast​(java.util.List<WeekDefinition> listWeek, java.time.LocalDate dateToSearch)
      Return the closest Week in past a list of date with the given date
      static java.time.format.DateTimeFormatter getFormatter()
      Getter for the formatter
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFormatter

        public static java.time.format.DateTimeFormatter getFormatter()
        Getter for the formatter
        Returns:
        the formatter
      • getClosestDateInPast

        public static java.time.LocalDate getClosestDateInPast​(java.util.List<java.time.LocalDate> listDate,
                                                               java.time.LocalDate dateToSearch)
        Return the closest date in past a list of date with the given date
        Parameters:
        listDate - the list of date
        dateToSearch - the date to search
        Returns:
        the closest date in past
      • getClosestWeekDefinitionInPast

        public static WeekDefinition getClosestWeekDefinitionInPast​(java.util.List<WeekDefinition> listWeek,
                                                                    java.time.LocalDate dateToSearch)
        Return the closest Week in past a list of date with the given date
        Parameters:
        listDate - the list of date
        dateToSearch - the date to search
        Returns:
        the closest week in past
      • getClosestDateTimeInFuture

        public static java.time.LocalDateTime getClosestDateTimeInFuture​(java.util.List<java.time.LocalDateTime> listDateTime,
                                                                         java.time.LocalDateTime dateTimeToSearch)
        Return the closest date time in future in a list of date time and a given date time
        Parameters:
        listDateTime - the list of date time
        dateTimeToSearch - the date time to search
        Returns:
        the closest date time in the list in the future of the given date time