Interface HasDateRange

All Known Subinterfaces:
Entity, EntityExtended, HasMutableDateRange, MutableEntity, MutableEntityExtended
All Known Implementing Classes:
Document, EntityExtendedImp, MutableEntityExtendedImp

public interface HasDateRange
Define a mixin with an absolute time range. The time range can be open on one or both sides.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Test if the date range is partially inside the date range specified in the filter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    String representation of the property associated with the mixin.
    static final String
    String representation of the property associated with the mixin.
  • Method Summary

    Modifier and Type
    Method
    Description
    default LocalDate
    Return the date from when the entity is existing and active.
    default boolean
    Return true if the date now is in the time range of the instance.
    default boolean
    isActive(@NotNull LocalDate date)
    Return true if the date is in the time range of the instance.
    Return the range of the mixin.
    default LocalDate
    to()
    Return the date until when the entity is existing and active.
  • Field Details

  • Method Details

    • range

      DateRange range()
      Return the range of the mixin.
      Returns:
      date range of the mixin
    • from

      default LocalDate from()
      Return the date from when the entity is existing and active.
      Returns:
      the start of the existing period for the entity
    • to

      default LocalDate to()
      Return the date until when the entity is existing and active.
      Returns:
      the end of the existing period for the entity
    • isActive

      default boolean isActive(@NotNull @NotNull LocalDate date)
      Return true if the date is in the time range of the instance.
      Parameters:
      date - date against which the inclusion test is evaluated
      Returns:
      true if inside the range otherwise false
    • isActive

      default boolean isActive()
      Return true if the date now is in the time range of the instance.
      Returns:
      true if inside the range otherwise false