public final class GeneralizedTime extends Object implements Comparable<GeneralizedTime>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(GeneralizedTime o) |
static GeneralizedTime |
currentTime()
Returns a generalized time whose value is the current time, using the
default time zone and locale.
|
boolean |
equals(Object obj) |
long |
getTimeInMillis()
Returns the value of this generalized time in milliseconds since the
epoch.
|
int |
hashCode() |
Calendar |
toCalendar()
Returns a
Calendar representation of this generalized time. |
Date |
toDate()
Returns a
Date representation of this generalized time. |
String |
toString() |
static GeneralizedTime |
valueOf(Calendar calendar)
Returns a generalized time representing the provided
Calendar. |
static GeneralizedTime |
valueOf(Date date)
Returns a generalized time representing the provided
Date. |
static GeneralizedTime |
valueOf(long timeMS)
Returns a generalized time representing the provided time in milliseconds
since the epoch.
|
static GeneralizedTime |
valueOf(String time)
Parses the provided string as an LDAP generalized time.
|
public static GeneralizedTime currentTime()
public static GeneralizedTime valueOf(Calendar calendar)
Calendar.
The provided calendar will be defensively copied in order to preserve immutability.
calendar - The calendar to be converted to a generalized time.Calendar.public static GeneralizedTime valueOf(Date date)
Date.
The provided date will be defensively copied in order to preserve immutability.
date - The date to be converted to a generalized time.Date.public static GeneralizedTime valueOf(long timeMS)
timeMS - The time to be converted to a generalized time.public static GeneralizedTime valueOf(String time)
time - The generalized time value to be parsed.LocalizedIllegalArgumentException - If time cannot be parsed as a valid generalized time
string.NullPointerException - If time was null.public int compareTo(GeneralizedTime o)
compareTo in interface Comparable<GeneralizedTime>public long getTimeInMillis()
public Calendar toCalendar()
Calendar representation of this generalized time.
Subsequent modifications to the returned calendar will not alter the internal state of this generalized time.
Calendar representation of this generalized time.public Date toDate()
Date representation of this generalized time.
Subsequent modifications to the returned date will not alter the internal state of this generalized time.
Date representation of this generalized time.Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.