javax.cache
Class CacheConfiguration.Duration

java.lang.Object
  extended by javax.cache.CacheConfiguration.Duration
Enclosing interface:
CacheConfiguration<K,V>

public static class CacheConfiguration.Duration
extends Object

A time duration.


Field Summary
static CacheConfiguration.Duration ETERNAL
          ETERNAL
 
Constructor Summary
CacheConfiguration.Duration(TimeUnit timeUnit, long durationAmount)
          Constructs a duration.
 
Method Summary
 boolean equals(Object o)
           
 long getDurationAmount()
           
 TimeUnit getTimeUnit()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ETERNAL

public static final CacheConfiguration.Duration ETERNAL
ETERNAL

Constructor Detail

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
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

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.