Package org.ehcache.expiry
Class Duration
java.lang.Object
org.ehcache.expiry.Duration
Deprecated.
A time duration in a given
TimeUnit.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.longDeprecated.Gets the length of time thisDurationrepresents.Deprecated.Gets theTimeUnitof thisDuration.inthashCode()Deprecated.booleanDeprecated.Indicates if this duration representsINFINITEor an infiniteDuration.static DurationDeprecated.Convenience method to create aDurationwith the specified values.toString()Deprecated.
-
Field Details
-
INFINITE
Deprecated.The infiniteDuration.This constant should be used to express a lack of a concrete expiration time (ie. "eternal").
-
ZERO
Deprecated.The zeroDuration.
-
-
Constructor Details
-
Duration
Deprecated.Instantiates a newDurationof the given length andTimeUnit.- Parameters:
length- the duration lengthtimeUnit- the time unit- Throws:
NullPointerException- if the given time unit is nullIllegalArgumentException- if the given length is less than zero
-
-
Method Details
-
of
Deprecated.Convenience method to create aDurationwith the specified values.- Parameters:
length- the duration lengthtimeUnit- the time unit- Returns:
- a new
Duration - See Also:
-
getLength
public long getLength()Deprecated.Gets the length of time thisDurationrepresents.- Returns:
- the length of this instance
- Throws:
IllegalStateException- if this instance isINFINITE- See Also:
-
getTimeUnit
Deprecated.Gets theTimeUnitof thisDuration.- Returns:
- the
TimeUnitof this instance - Throws:
IllegalStateException- if this instance isINFINITE- See Also:
-
isInfinite
public boolean isInfinite()Deprecated.Indicates if this duration representsINFINITEor an infiniteDuration.- Returns:
trueif this instance is the specialForevervalue
-
hashCode
public int hashCode()Deprecated. -
equals
Deprecated. -
toString
Deprecated.
-
Duration