Package org.eclipse.hono.cache
Interface ExpiringValue<T>
-
- Type Parameters:
T
- The type of value.
- All Known Implementing Classes:
BasicExpiringValue
public interface ExpiringValue<T>
A generic value with a limited validity period.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
getValue()
Gets the value.boolean
isExpired()
Checks if the value has already expired.boolean
isExpired(Instant refInstant)
Checks if the value has already expired.
-
-
-
Method Detail
-
getValue
T getValue()
Gets the value.- Returns:
- The value.
-
isExpired
boolean isExpired()
Checks if the value has already expired.- Returns:
true
if the value has expired based on the current system time,false
otherwise.
-
isExpired
boolean isExpired(Instant refInstant)
Checks if the value has already expired.- Parameters:
refInstant
- The reference point in time to check expiration against.- Returns:
true
if the value has expired based on the given instant,false
otherwise.- Throws:
NullPointerException
- if the instant isnull
.
-
-