public class IdentifierLongConverter extends Object implements LongConverter
The base 66 encoding support 0-9, A-Z, a-z, period, underscore, tilde and caret. Leading zeros are truncated.
As this is intended for timestamps based on the wall clock, these shouldn't conflict.
Negative ids are reserved for application specific encodings.
| Modifier and Type | Field and Description |
|---|---|
static IdentifierLongConverter |
INSTANCE |
protected static long |
MAX_SMALL_ID |
protected static SymbolsLongConverter |
SMALL_POSITIVE |
| Modifier | Constructor and Description |
|---|---|
protected |
IdentifierLongConverter()
Default constructor that's protected to prevent direct instantiation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
Appends a long identifier to a provided
Bytes instance. |
void |
append(StringBuilder text,
long value)
Appends a long identifier to a provided
StringBuilder instance. |
int |
maxParseLength()
Returns the maximum length of the
CharSequence that this converter is able
to parse, which in this case is the maximum parse length of
the NanoTimestampLongConverter. |
long |
parse(CharSequence text)
Parses the provided
CharSequence into a long identifier. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddEncode, allSafeChars, asString, asText, asText, forSymbols, lengthCheck, maxParseLengthpublic static final IdentifierLongConverter INSTANCE
protected static final SymbolsLongConverter SMALL_POSITIVE
protected static final long MAX_SMALL_ID
protected IdentifierLongConverter()
public long parse(CharSequence text)
CharSequence into a long identifier.
The parsing behavior changes depending on the length of the CharSequence.parse in interface LongConvertertext - the CharSequence to parsepublic void append(StringBuilder text, long value)
StringBuilder instance.
The behavior changes depending on the magnitude of the identifier.append in interface LongConvertertext - the StringBuilder to append the identifier tovalue - the long identifierpublic void append(net.openhft.chronicle.bytes.Bytes<?> bytes,
long value)
Bytes instance.
The behavior changes depending on the magnitude of the identifier.append in interface LongConverterbytes - the Bytes to append the identifier tovalue - the long identifierpublic int maxParseLength()
CharSequence that this converter is able
to parse, which in this case is the maximum parse length of
the NanoTimestampLongConverter.maxParseLength in interface LongConverterCopyright © 2023. All rights reserved.