Package net.tangly.core
Interface HasDateRange
- All Known Subinterfaces:
Entity,EntityExtended,HasMutableDateRange,MutableEntity,MutableEntityExtended
- All Known Implementing Classes:
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 ClassesModifier and TypeInterfaceDescriptionstatic final recordHasDateRange.RangeFilter<T extends HasDateRange>Test if the date range is partially inside the date range specified in the filter. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault LocalDatefrom()Return the date from when the entity is existing and active.default booleanisActive()Return true if the date now is in the time range of the instance.default booleanReturn true if the date is in the time range of the instance.range()Return the range of the mixin.default LocalDateto()Return the date until when the entity is existing and active.
-
Field Details
-
FROM
-
TO
-
-
Method Details
-
range
-
from
Return the date from when the entity is existing and active.- Returns:
- the start of the existing period for the entity
-
to
Return the date until when the entity is existing and active.- Returns:
- the end of the existing period for the entity
-
isActive
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
-