public abstract class AbstractImmutableRawValue extends AbstractImmutableValue implements ImmutableRawValue
| Modifier and Type | Field and Description |
|---|---|
private java.nio.charset.CharacterCodingException |
codingException |
protected byte[] |
data |
private java.lang.String |
decodedStringCache |
private static char[] |
HEX_TABLE |
| Constructor and Description |
|---|
AbstractImmutableRawValue(byte[] data) |
AbstractImmutableRawValue(java.lang.String string) |
| Modifier and Type | Method and Description |
|---|---|
(package private) static void |
appendJsonString(java.lang.StringBuilder sb,
java.lang.String string) |
byte[] |
asByteArray()
Returns the value as
byte[]. |
java.nio.ByteBuffer |
asByteBuffer()
Returns the value as
ByteBuffer. |
ImmutableRawValue |
asRawValue()
Returns the value as
RawValue. |
java.lang.String |
asString()
Returns the value as
String. |
private void |
decodeString() |
private static void |
escapeChar(java.lang.StringBuilder sb,
int ch) |
java.lang.String |
toJson()
Returns json representation of this Value.
|
java.lang.String |
toString()
Returns the value as
String. |
asArrayValue, asBinaryValue, asBooleanValue, asExtensionValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asNumberValue, asStringValue, asTimestampValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasArrayValue, asBinaryValue, asBooleanValue, asFloatValue, asIntegerValue, asMapValue, asNilValue, asStringValue, asTimestampValueasExtensionValue, asNumberValue, equals, getValueType, immutableValue, isArrayValue, isBinaryValue, isBooleanValue, isExtensionValue, isFloatValue, isIntegerValue, isMapValue, isNilValue, isNumberValue, isRawValue, isStringValue, isTimestampValue, writeToprotected final byte[] data
private volatile java.lang.String decodedStringCache
private volatile java.nio.charset.CharacterCodingException codingException
private static final char[] HEX_TABLE
public AbstractImmutableRawValue(byte[] data)
public AbstractImmutableRawValue(java.lang.String string)
public ImmutableRawValue asRawValue()
ValueRawValue. Otherwise throws MessageTypeCastException.
Note that you can't use instanceof or cast ((RawValue) thisValue) to check type of a value because type of a mutable value is variable.asRawValue in interface ImmutableValueasRawValue in interface ValueasRawValue in class AbstractImmutableValuepublic byte[] asByteArray()
RawValuebyte[].
This method copies the byte array.asByteArray in interface RawValuepublic java.nio.ByteBuffer asByteBuffer()
RawValueByteBuffer.
Returned ByteBuffer is read-only. See also ByteBuffer.asReadOnlyBuffer().
This method doesn't copy the byte array as much as possible.asByteBuffer in interface RawValuepublic java.lang.String asString()
RawValueString.
This method throws an exception if the value includes invalid UTF-8 byte sequence.public java.lang.String toJson()
ValueFollowing behavior is not configurable at this release and they might be changed at future releases:
U+FFFD replacement character.U+FFFD replacement characterprivate void decodeString()
public java.lang.String toString()
RawValueString.
This method replaces an invalid UTF-8 byte sequence with U+FFFD replacement character.static void appendJsonString(java.lang.StringBuilder sb,
java.lang.String string)
private static void escapeChar(java.lang.StringBuilder sb,
int ch)