Package com.helger.datetime.expiration
Interface IExpirable
-
- All Known Subinterfaces:
IExpirableWithReplacement<DATATYPE>,IMutableExpirable,IMutableExpirableWithReplacement<DATATYPE>
- All Known Implementing Classes:
Expirable,ExpirableWithReplacement
public interface IExpirableRead-only interface for objects that can expire.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description LocalDateTimegetExpirationDateTime()default booleanisExpirationDefined()Check if the object has an expiration date defined.default booleanisExpiredAt(LocalDateTime aDT)Check if this object is expired at the provided date time.default booleanisExpiredNow()Check if this object is already expired.
-
-
-
Method Detail
-
getExpirationDateTime
@Nullable LocalDateTime getExpirationDateTime()
- Returns:
- The date time when the object will expire/expired. May be
nullif no expiration is defined.
-
isExpirationDefined
default boolean isExpirationDefined()
Check if the object has an expiration date defined. To check if the object is already expired, useisExpiredNow()instead.- Returns:
trueif an expiration date is defined,falseotherwise.
-
isExpiredNow
default boolean isExpiredNow()
Check if this object is already expired. This is only possible if an expiration date is defined.- Returns:
trueif an expiration date is defined and the expiration date is in the past,falseotherwise.- See Also:
isExpirationDefined()
-
isExpiredAt
default boolean isExpiredAt(@Nonnull LocalDateTime aDT)
Check if this object is expired at the provided date time. This is only possible if an expiration date is defined.- Parameters:
aDT- The date time to check against. May not benull.- Returns:
trueif an expiration date is defined and the expiration date is in the past,falseotherwise.- See Also:
isExpirationDefined()
-
-