Package org.forgerock.opendj.ldap
Class GeneralizedTime
java.lang.Object
org.forgerock.opendj.ldap.GeneralizedTime
- All Implemented Interfaces:
Comparable<GeneralizedTime>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final GeneralizedTimeThe smallest time representable using the generalized time syntax.static final longThe smallest time in milli-seconds representable using the generalized time syntax. -
Method Summary
Modifier and TypeMethodDescriptionintstatic GeneralizedTimeReturns a generalized time whose value is the current time, using the default time zone and locale.booleanlongReturns the value of this generalized time in milliseconds since the epoch.inthashCode()Returns aCalendarrepresentation of this generalized time.Returns aOffsetDateTimerepresentation of this generalized time.toString()static GeneralizedTimevalueOf(long timeMS) Returns a generalized time representing the provided time in milliseconds since the epoch.static GeneralizedTimeParses the provided string as an LDAP generalized time.static GeneralizedTimeReturns a generalized time representing the provided instant in milliseconds since the epoch.static GeneralizedTimevalueOf(OffsetDateTime offsetDateTime) Returns a generalized time representing the providedOffsetDateTime.static GeneralizedTimeReturns a generalized time representing the providedCalendar.static GeneralizedTimeReturns a generalized time representing the providedDate.
-
Field Details
-
MIN_GENERALIZED_TIME
The smallest time representable using the generalized time syntax. -
MIN_GENERALIZED_TIME_MS
public static final long MIN_GENERALIZED_TIME_MSThe smallest time in milli-seconds representable using the generalized time syntax.
-
-
Method Details
-
currentTime
Returns a generalized time whose value is the current time, using the default time zone and locale.- Returns:
- A generalized time whose value is the current time.
-
valueOf
Returns a generalized time representing the providedCalendar.- Parameters:
calendar- The calendar to be converted to a generalized time.- Returns:
- A generalized time representing the provided
Calendar.
-
valueOf
Returns a generalized time representing the providedDate.- Parameters:
date- The date to be converted to a generalized time.- Returns:
- A generalized time representing the provided
Date.
-
valueOf
Returns a generalized time representing the provided time in milliseconds since the epoch.- Parameters:
timeMS- The time to be converted to a generalized time.- Returns:
- A generalized time representing the provided time in milliseconds since the epoch.
-
valueOf
Returns a generalized time representing the provided instant in milliseconds since the epoch.- Parameters:
instant- The instant to be converted to a generalized time.- Returns:
- A generalized time representing the provided instant in milliseconds since the epoch.
-
valueOf
Parses the provided string as an LDAP generalized time.- Parameters:
time- The generalized time value to be parsed.- Returns:
- The parsed generalized time.
- Throws:
LocalizedIllegalArgumentException- Iftimecannot be parsed as a valid generalized time string.NullPointerException- Iftimewasnull.
-
valueOf
Returns a generalized time representing the providedOffsetDateTime.- Parameters:
offsetDateTime- TheOffsetDateTimeto be converted to a generalized time.- Returns:
- A generalized time representing the provided
OffsetDateTime. - See Also:
-
getTimeInMillis
public long getTimeInMillis()Returns the value of this generalized time in milliseconds since the epoch.- Returns:
- The value of this generalized time in milliseconds since the epoch.
-
toOffsetDateTime
Returns aOffsetDateTimerepresentation of this generalized time.- Returns:
- A
OffsetDateTimerepresentation of this generalized time. - See Also:
-
toCalendar
Returns aCalendarrepresentation of this generalized time.Subsequent modifications to the returned calendar will not alter the internal state of this generalized time.
- Returns:
- A
Calendarrepresentation of this generalized time.
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<GeneralizedTime>
-
toString
-