U - type of time unitpublic static final class TimeSpan.Item<U> extends Object implements Serializable
Represents a single item of a time span which is based on only one time unit and has a non-negative amount.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
long |
getAmount()
Yields the non-negative amount.
|
U |
getUnit()
Yields the time unit.
|
int |
hashCode() |
static <U> TimeSpan.Item<U> |
of(long amount,
U unit)
Creates a new time span item.
|
String |
toString()
Provides a canonical representation in the format
'P' amount '{' unit '}', for example "P4{YEARS}".
|
public static <U> TimeSpan.Item<U> of(long amount, U unit)
Creates a new time span item.
U - type of time unitamount - amount in units >= 0unit - time unitIllegalArgumentException - if amount is negativepublic long getAmount()
Yields the non-negative amount.
>= 0)public U getUnit()
Yields the time unit.
Copyright © 2014–2015. All rights reserved.