Class Utilities


  • public final class Utilities
    extends Object
    Class of utilities
    • Method Detail

      • getFormatter

        public static DateTimeFormatter getFormatter()
        Getter for the formatter
        Returns:
        the formatter
      • getClosestDateInPast

        public static LocalDate getClosestDateInPast​(List<LocalDate> listDate,
                                                     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​(List<WeekDefinition> listWeek,
                                                                    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 LocalDateTime getClosestDateTimeInFuture​(List<LocalDateTime> listDateTime,
                                                               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