Duration
@Deprecated @PublicEvolving public final class Time extends Object implements Serializable
Duration
.Modifier and Type | Method and Description |
---|---|
static Time |
days(long days)
Deprecated.
Creates a new
Time that represents the given number of days. |
boolean |
equals(Object o)
Deprecated.
|
static Time |
fromDuration(Duration duration)
Deprecated.
Creates a new
Time that represents the number of milliseconds in the given duration. |
long |
getSize()
Deprecated.
Gets the length of this policy's time interval.
|
TimeUnit |
getUnit()
Deprecated.
Gets the time unit for this policy's time interval.
|
int |
hashCode()
Deprecated.
|
static Time |
hours(long hours)
Deprecated.
Creates a new
Time that represents the given number of hours. |
static Time |
milliseconds(long milliseconds)
Deprecated.
Creates a new
Time that represents the given number of milliseconds. |
static Time |
minutes(long minutes)
Deprecated.
Creates a new
Time that represents the given number of minutes. |
static Time |
of(long size,
TimeUnit unit)
Deprecated.
|
static Time |
seconds(long seconds)
Deprecated.
Creates a new
Time that represents the given number of seconds. |
Duration |
toDuration()
Deprecated.
|
static Duration |
toDuration(Time time)
Deprecated.
|
long |
toMilliseconds()
Deprecated.
Converts the time interval to milliseconds.
|
long |
toSeconds()
Deprecated.
Converts the time interval to seconds.
|
String |
toString()
Deprecated.
|
public TimeUnit getUnit()
public long getSize()
public Duration toDuration()
public long toMilliseconds()
public long toSeconds()
public static Time of(long size, TimeUnit unit)
size
- The duration of time.unit
- The unit of time of the duration, for example TimeUnit.SECONDS
.public static Time milliseconds(long milliseconds)
Time
that represents the given number of milliseconds.public static Time seconds(long seconds)
Time
that represents the given number of seconds.public static Time minutes(long minutes)
Time
that represents the given number of minutes.public static Time hours(long hours)
Time
that represents the given number of hours.public static Time days(long days)
Time
that represents the given number of days.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.