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.
ETERNAL
public static final CacheConfiguration.Duration ETERNAL
- ETERNAL
CacheConfiguration.Duration
public CacheConfiguration.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 null
IllegalArgumentException
- if durationAmount is less than 0 or a TimeUnit less than milliseconds is specified
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
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
Copyright © 2012. All Rights Reserved.