Interface ILocalDatePeriod

    • Method Detail

      • isInside

        static boolean isInside​(@Nullable
                                LocalDate aStart,
                                boolean bInclStart,
                                @Nullable
                                LocalDate aEnd,
                                boolean bInclEnd,
                                @Nonnull
                                LocalDate aQuery)
        Check if the provided query date is between start and end. A null start means "since forever". A null end means "until eternity and beyond".
        Parameters:
        aStart - Start date. May be null.
        bInclStart - true if "start date" = "query date" should be a match, false if not.
        aEnd - End date may be null.
        bInclEnd - true if "end date" = "query date" should be a match, false if not.
        aQuery - Date to query whether it is inside or not. May not be null.
        Returns:
        true if query date ≥ start date and ≤ end date
        Since:
        10.0.0
      • isInPeriod

        default boolean isInPeriod​(boolean bInclBoundaries,
                                   @Nonnull
                                   LocalDate aDate)
        Check if the provided date is inside this period, assuming that start and end are included in/part of the range.
        Parameters:
        bInclBoundaries - true if "start date" = "query date" should be a match i.e. if "end date" = "query date" should be a match, false if this should not be a match.
        aDate - Date to check. May not be null.
        Returns:
        true if it is contained, false otherwise.
        Since:
        10.0.0
        See Also:
        isInside(LocalDate, boolean, LocalDate, boolean, LocalDate)
      • isInPeriodIncl

        default boolean isInPeriodIncl​(@Nonnull
                                       LocalDate aDate)
        Check if the provided date is inside this period, assuming that start and end are included in/part of the range.
        Parameters:
        aDate - Date to check. May not be null.
        Returns:
        true if it is contained, false otherwise.
        Since:
        8.6.5
        See Also:
        isInPeriod(boolean, LocalDate), isNowInPeriodIncl()
      • isNowInPeriodIncl

        default boolean isNowInPeriodIncl()
        Check if the current date is inside this period, assuming that start and end are included in/part of the range.
        Returns:
        true if the current date is contained, false otherwise.
        Since:
        8.6.5
        See Also:
        isInPeriod(boolean, LocalDate), isInPeriodIncl(LocalDate)
      • isInPeriodExcl

        default boolean isInPeriodExcl​(@Nonnull
                                       LocalDate aDate)
        Check if the provided date is inside this period, assuming that start and end are excluded from/not part of the range.
        Parameters:
        aDate - Date to check. May not be null.
        Returns:
        true if it is contained, false otherwise.
        Since:
        8.6.5
        See Also:
        isInPeriod(boolean, LocalDate), isNowInPeriodExcl()
      • isNowInPeriodExcl

        default boolean isNowInPeriodExcl()
        Check if the current date is inside this period, assuming that start and end are excluded from/not part of the range.
        Returns:
        true if the current date is contained, false otherwise.
        Since:
        8.6.5
        See Also:
        isInPeriod(boolean, LocalDate), isInPeriodExcl(LocalDate)
      • hasOverlap

        static boolean hasOverlap​(@Nullable
                                  LocalDate aStart1,
                                  @Nullable
                                  LocalDate aEnd1,
                                  @Nullable
                                  LocalDate aStart2,
                                  @Nullable
                                  LocalDate aEnd2,
                                  boolean bInclBoundaries)
        Check if the provided range 1 has an overlap with the provided range 2.
        Parameters:
        aStart1 - Start date of the first range. May be null.
        aEnd1 - End date of the first range. May be null meaning it's validity is "until eternity and beyond".
        aStart2 - Start date of the second range. May be null.
        aEnd2 - End date of the second range. May be null meaning it's validity is "until eternity and beyond".
        bInclBoundaries - true if "start date" = "query date" should be a match i.e. if "end date" = "query date" should be a match, false if this should not be a match.
        Returns:
        true if the 2 ranges have at least one point in time (with duration 0) that they share.
        Since:
        10.0.0
      • isOverlappingWith

        default boolean isOverlappingWith​(@Nonnull
                                          ILocalDatePeriod aPeriod,
                                          boolean bInclBoundaries)