Package org.ehcache.expiry
Class Duration
- java.lang.Object
-
- org.ehcache.expiry.Duration
-
@Deprecated public final class Duration extends Object
Deprecated.Replaced withDurationA time duration in a givenTimeUnit.- See Also:
Duration,ExpiryPolicy
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Deprecated.longgetLength()Deprecated.Gets the length of time thisDurationrepresents.TimeUnitgetTimeUnit()Deprecated.Gets theTimeUnitof thisDuration.inthashCode()Deprecated.booleanisInfinite()Deprecated.Indicates if this duration representsINFINITEor an infiniteDuration.static Durationof(long length, TimeUnit timeUnit)Deprecated.Convenience method to create aDurationwith the specified values.StringtoString()Deprecated.
-
-
-
Constructor Detail
-
Duration
public Duration(long length, TimeUnit timeUnit)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 Detail
-
of
public static Duration of(long length, 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:
IllegalStateException- if this instance isINFINITE- See Also:
getTimeUnit()
-
getTimeUnit
public TimeUnit getTimeUnit()
Deprecated.Gets theTimeUnitof thisDuration.- Returns:
- the
TimeUnitof this instance - Throws:
IllegalStateException- if this instance isINFINITE- See Also:
getLength()
-
isInfinite
public boolean isInfinite()
Deprecated.Indicates if this duration representsINFINITEor an infiniteDuration.- Returns:
trueif this instance is the specialForevervalue
-
-