public class Time
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Time(long size,
java.util.concurrent.TimeUnit unit)
Initializes Time
|
Modifier and Type | Method and Description |
---|---|
static Time |
days(long days)
Set Time with length and days
|
boolean |
equals(java.lang.Object o) |
long |
getSize()
Returns size of the time unit
|
java.util.concurrent.TimeUnit |
getUnit()
Returns the TimeUnit type
|
int |
hashCode() |
static Time |
hours(long hours)
Set Time with length and hours
|
static Time |
milliseconds(long milliseconds)
Set Time with length with milliseconds
|
static Time |
minutes(long minutes)
Set Time with length and minutes
|
static Time |
of(long size,
java.util.concurrent.TimeUnit unit)
Set Time with length and TimeUnit
|
static Time |
seconds(long seconds)
Set Time with length and seconds
|
long |
toMilliseconds()
Returns the TimeUnit value in Milliseconds
|
java.lang.String |
toString() |
public Time(long size, java.util.concurrent.TimeUnit unit)
size
- time periodunit
- TimeUnit typepublic long getSize()
public java.util.concurrent.TimeUnit getUnit()
public long toMilliseconds()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static Time of(long size, java.util.concurrent.TimeUnit unit)
size
- length of the time durationunit
- TimeUnit typepublic static Time milliseconds(long milliseconds)
milliseconds
- Time as millisecondspublic static Time seconds(long seconds)
seconds
- Time as secondspublic static Time minutes(long minutes)
minutes
- Time as minutespublic static Time hours(long hours)
hours
- Time as hourspublic static Time days(long days)
days
- Time as days