Package javax.cache
Class CacheConfiguration.Duration
- java.lang.Object
-
- javax.cache.CacheConfiguration.Duration
-
- Enclosing interface:
- CacheConfiguration<K,V>
public static class CacheConfiguration.Duration extends Object
A time duration.
-
-
Field Summary
Fields Modifier and Type Field Description static CacheConfiguration.DurationETERNALETERNAL
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)longgetDurationAmount()TimeUnitgetTimeUnit()inthashCode()
-
-
-
Field Detail
-
ETERNAL
public static final CacheConfiguration.Duration ETERNAL
ETERNAL
-
-
Constructor Detail
-
Duration
public Duration(TimeUnit timeUnit, long durationAmount)
Constructs a duration.- Parameters:
timeUnit- the unit of time to specify time in. The minimum time unit is milliseconds.durationAmount- how long, in the specified units, the cache entries should live. 0 means eternal.- Throws:
NullPointerException- if timeUnit is nullIllegalArgumentException- if durationAmount is less than 0 or a TimeUnit less than milliseconds is specified
-
-
Method Detail
-
getTimeUnit
public TimeUnit getTimeUnit()
- Returns:
- the TimeUnit used to specify this duration
-
getDurationAmount
public long getDurationAmount()
- Returns:
- the number of TimeUnits which quantify this duration
-
-