Package org.ehcache.expiry
Class Duration
- java.lang.Object
-
- org.ehcache.expiry.Duration
-
@Deprecated public final class Duration extends java.lang.ObjectDeprecated.Replaced withDurationA time duration in a givenTimeUnit.- See Also:
Duration,ExpiryPolicy
-
-
Constructor Summary
Constructors Modifier Constructor Description Duration(long length, java.util.concurrent.TimeUnit timeUnit)Deprecated.Instantiates a newDurationof the given length andTimeUnit.privateDuration(long length, java.util.concurrent.TimeUnit timeUnit, boolean forever)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private voidcheckInfinite()Deprecated.booleanequals(java.lang.Object obj)Deprecated.longgetLength()Deprecated.Gets the length of time thisDurationrepresents.java.util.concurrent.TimeUnitgetTimeUnit()Deprecated.Gets theTimeUnitof thisDuration.inthashCode()Deprecated.booleanisInfinite()Deprecated.Indicates if this duration representsINFINITEor an infiniteDuration.static Durationof(long length, java.util.concurrent.TimeUnit timeUnit)Deprecated.Convenience method to create aDurationwith the specified values.java.lang.StringtoString()Deprecated.
-
-
-
Field Detail
-
INFINITE
public static final Duration INFINITE
Deprecated.The infiniteDuration.This constant should be used to express a lack of a concrete expiration time (ie. "eternal").
-
ZERO
public static final Duration ZERO
Deprecated.The zeroDuration.
-
timeUnit
private final java.util.concurrent.TimeUnit timeUnit
Deprecated.
-
length
private final long length
Deprecated.
-
-
Constructor Detail
-
Duration
public Duration(long length, java.util.concurrent.TimeUnit timeUnit)Deprecated.Instantiates a newDurationof the given length andTimeUnit.- Parameters:
length- the duration lengthtimeUnit- the time unit- Throws:
java.lang.NullPointerException- if the given time unit is nulljava.lang.IllegalArgumentException- if the given length is less than zero
-
Duration
private Duration(long length, java.util.concurrent.TimeUnit timeUnit, boolean forever)Deprecated.
-
-
Method Detail
-
of
public static Duration of(long length, java.util.concurrent.TimeUnit timeUnit)
Deprecated.Convenience method to create aDurationwith the specified values.- Parameters:
length- the duration lengthtimeUnit- the time unit- Returns:
- a new
Duration - See Also:
Duration(long, TimeUnit)
-
getLength
public long getLength()
Deprecated.Gets the length of time thisDurationrepresents.- Returns:
- the length of this instance
- Throws:
java.lang.IllegalStateException- if this instance isINFINITE- See Also:
getTimeUnit()
-
getTimeUnit
public java.util.concurrent.TimeUnit getTimeUnit()
Deprecated.Gets theTimeUnitof thisDuration.- Returns:
- the
TimeUnitof this instance - Throws:
java.lang.IllegalStateException- if this instance isINFINITE- See Also:
getLength()
-
checkInfinite
private void checkInfinite()
Deprecated.
-
isInfinite
public boolean isInfinite()
Deprecated.Indicates if this duration representsINFINITEor an infiniteDuration.- Returns:
trueif this instance is the specialForevervalue
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
Deprecated.- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
Deprecated.- Overrides:
toStringin classjava.lang.Object
-
-