public abstract class AbstractTimestampLongConverter extends Object implements LongConverter
All long values are assumed to be timestamps in UTC.
Parsing of ISO dates with or without timestamps is supported. When an ISO date is read with no timezone, it is assumed to be in the converter's zone.
| Modifier and Type | Field and Description |
|---|---|
static String |
TIMESTAMP_LONG_CONVERTERS_ZONE_ID_SYSTEM_PROPERTY |
static ZoneId |
UTC |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractTimestampLongConverter(String zoneId,
TimeUnit timeUnit) |
protected |
AbstractTimestampLongConverter(TimeUnit timeUnit) |
| Modifier and Type | Method and Description |
|---|---|
void |
append(Appendable text,
long value) |
void |
append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
* Appends to provided
value to the provided text. |
void |
append(StringBuilder text,
long value)
Appends the provided
value to the provided text. |
protected abstract void |
appendFraction(DateTimeFormatterBuilder builder)
Append any fractions we expect to parse
|
long |
parse(CharSequence text)
Parses the provided
CharSequence and returns the parsed results as a
long primitive. |
protected abstract long |
parseFormattedDate(ZonedDateTime value)
Interpret formatted date
|
protected abstract long |
parseTimestamp(long value,
CharSequence text)
Interpret long timestamp
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEncode, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, maxParseLength, maxParseLengthpublic static final ZoneId UTC
public static final String TIMESTAMP_LONG_CONVERTERS_ZONE_ID_SYSTEM_PROPERTY
protected AbstractTimestampLongConverter(TimeUnit timeUnit)
public long parse(CharSequence text)
LongConverterCharSequence and returns the parsed results as a
long primitive.parse in interface LongConvertertext as an long primitive.protected abstract long parseFormattedDate(ZonedDateTime value)
value - The parsed formatted date (in UTC zone)protected abstract long parseTimestamp(long value,
CharSequence text)
value - The parsed timestampprotected abstract void appendFraction(DateTimeFormatterBuilder builder)
builder - The builder after the initial date format has been addedpublic void append(Appendable text, long value)
public void append(StringBuilder text, long value)
LongConvertervalue to the provided text.append in interface LongConverterpublic void append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
LongConvertervalue to the provided text.append in interface LongConvertervalue - to append as textCopyright © 2022. All rights reserved.