public class MicroTimestampLongConverter extends AbstractTimestampLongConverter
MicroTimestampLongConverter is an implementation of AbstractTimestampLongConverter
which handles conversions between long timestamps and date-time strings.
The precision of this converter is to the microsecond.
This converter is singleton, the instance can be accessed using the public field INSTANCE.| Modifier and Type | Field and Description |
|---|---|
static MicroTimestampLongConverter |
INSTANCE
The singleton instance of this converter.
|
INCLUDE_ZONE_SUFFIX_WHEN_ZONE_IS_UTC_SYSTEM_PROPERTY, TIMESTAMP_LONG_CONVERTERS_ZONE_ID_SYSTEM_PROPERTY, UTC| Constructor and Description |
|---|
MicroTimestampLongConverter()
Constructs a new
MicroTimestampLongConverter with the default zone ID (fetched from the system property or UTC). |
MicroTimestampLongConverter(String zoneId)
Constructs a new
MicroTimestampLongConverter with the specified zone ID. |
MicroTimestampLongConverter(String zoneId,
boolean includeZoneSuffixForUTC)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
appendFraction(DateTimeFormatterBuilder builder)
Appends the fraction of the second to the provided
DateTimeFormatterBuilder. |
protected long |
parseFormattedDate(ZonedDateTime value)
Parses a formatted date into a long timestamp.
|
protected long |
parseTimestamp(long value,
CharSequence text)
Parses a long timestamp.
|
append, append, append, parseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEncode, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, maxParseLength, maxParseLengthpublic static final MicroTimestampLongConverter INSTANCE
public MicroTimestampLongConverter()
MicroTimestampLongConverter with the default zone ID (fetched from the system property or UTC).
Supports the old system property for micro timestamps specifically.public MicroTimestampLongConverter(String zoneId)
MicroTimestampLongConverter with the specified zone ID.zoneId - the zone ID to be used for the conversion of long values@Deprecated public MicroTimestampLongConverter(String zoneId, boolean includeZoneSuffixForUTC)
MicroTimestampLongConverter with the specified zone ID and flag for including zone suffix for UTC.
This constructor is set to be deprecated in x.26 version.zoneId - the zone ID to be used for the conversion of long valuesincludeZoneSuffixForUTC - the flag to indicate if 'Z' suffix should be included for UTC zone timestampsprotected void appendFraction(DateTimeFormatterBuilder builder)
AbstractTimestampLongConverterDateTimeFormatterBuilder.appendFraction in class AbstractTimestampLongConverterbuilder - The builder after the initial date format has been addedprotected long parseFormattedDate(ZonedDateTime value)
parseFormattedDate in class AbstractTimestampLongConvertervalue - The parsed formatted date (in UTC zone)protected long parseTimestamp(long value,
CharSequence text)
parseTimestamp in class AbstractTimestampLongConvertervalue - The parsed timestamptext - The text version of the timestampCopyright © 2023. All rights reserved.