Package org.opencms.util
Class CmsExpiringValue<T>
- java.lang.Object
-
- org.opencms.util.CmsExpiringValue<T>
-
- Type Parameters:
T
- the type of the cached value
public class CmsExpiringValue<T> extends java.lang.Object
Simple utility class for caching a single value with a given cache expiration time.If the time between the last write operation and a read operation is longer than the expiration time, null will be returned from the read operation.
-
-
Constructor Summary
Constructors Constructor Description CmsExpiringValue(long expirationTime)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get()
Gets the cached value.void
set(T value)
Sets the cached value.
-
-
-
Constructor Detail
-
CmsExpiringValue
public CmsExpiringValue(long expirationTime)
Creates a new instance.- Parameters:
expirationTime
- the expiration time in milliseconds
-
-