public class TimePeriod extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static TimePeriod |
UNLIMITED
Time-period of "infinity" (time of
Long.MAX_VALUE ). |
static TimePeriod |
ZERO
Time-period of zero.
|
Modifier | Constructor and Description |
---|---|
protected |
TimePeriod(long value) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
long |
getNanos()
Returns value in nanoseconds.
|
int |
getSeconds() |
long |
getTime()
Returns value in milliseconds.
|
int |
hashCode() |
protected static long |
parse(String value) |
String |
toString() |
static TimePeriod |
valueOf(long value)
Returns
TimePeriod with value milliseconds. |
static TimePeriod |
valueOf(String value)
Returns
TimePeriod represented with a given string. |
public static final TimePeriod ZERO
public static final TimePeriod UNLIMITED
Long.MAX_VALUE
).public static TimePeriod valueOf(long value)
TimePeriod
with value milliseconds.value
- value in millisecondsTimePeriod
with value milliseconds.public static TimePeriod valueOf(String value) throws InvalidFormatException
TimePeriod
represented with a given string.
Allowable format is ISO8601 duration, but there are some simplifications and modifications available:
value
- string representationTimePeriod
represented with a given string.InvalidFormatException
- if cannot parse valueprotected static long parse(String value)
public long getTime()
public int getSeconds()
public long getNanos()
Copyright © 2002–2025 Devexperts LLC. All rights reserved.