Package com.complexible.common.base
Class Duration
- java.lang.Object
-
- com.complexible.common.base.Duration
-
- All Implemented Interfaces:
java.io.Serializable
public final class Duration extends java.lang.Object implements java.io.Serializable
Immutable representation of a duration.- Author:
- Evren Sirin
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
long
getMillis()
int
hashCode()
java.lang.String
toString()
String representation of durationlong
toUnit(java.util.concurrent.TimeUnit theUnit)
static Duration
valueOf(java.lang.String str)
Creates a duration instance from the string.
-
-
-
Method Detail
-
getMillis
public long getMillis()
-
toUnit
public long toUnit(java.util.concurrent.TimeUnit theUnit)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
String representation of duration- Overrides:
toString
in classjava.lang.Object
-
valueOf
public static Duration valueOf(java.lang.String str)
Creates a duration instance from the string.
-
-