@API.Internal
public class IdCodec
extends java.lang.Object
| Constructor and Description |
|---|
IdCodec() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
asString(org.ojai.Value in)
Returns the String representation of the Value.
|
static org.ojai.Value |
decode(byte[] in)
Decodes a Value from the provided byte array.
|
static org.ojai.Value |
decode(java.nio.ByteBuffer in)
Decodes a Value from the provided ByteBuffer.
|
static java.nio.ByteBuffer |
decodeBinary(java.nio.ByteBuffer in)
Decodes a BINARY value from the provided ByteBuffer.
|
static byte[] |
decodeBytes(byte[] in)
Decodes a BINARY value from the provided byte array.
|
static java.lang.String |
decodeString(byte[] in)
Decodes a STRING from the provided byte array.
|
static java.lang.String |
decodeString(java.nio.ByteBuffer in)
Decodes a STRING value from the provided ByteBuffer.
|
static java.nio.ByteBuffer |
encode(java.nio.ByteBuffer in)
Encodes a BINARY value into a ByteBuffer using the _id encoding scheme.
|
static java.nio.ByteBuffer |
encode(java.lang.String in)
Encodes a String into a ByteBuffer using the _id encoding scheme.
|
static java.nio.ByteBuffer |
encode(org.ojai.Value in)
Encodes a Value into a ByteBuffer using the _id encoding scheme.
|
static byte[] |
encodeAsBytes(byte[] in)
Encodes a BINARY value into a byte array using the _id encoding scheme.
|
static byte[] |
encodeAsBytes(java.nio.ByteBuffer in)
Encodes a BINARY value into a byte array using the _id encoding scheme.
|
static byte[] |
encodeAsBytes(java.lang.String in)
Encodes a String into a ByteBuffer using the _id encoding scheme.
|
static byte[] |
encodeAsBytes(org.ojai.Value in)
Encodes a Value into a byte array using the _id encoding scheme.
|
static byte[] |
encodeStringBinary(java.lang.String in)
Encode a binary encoded string using the _id encoding scheme.
|
static boolean |
isSupportedType(org.ojai.Value.Type type) |
public static boolean isSupportedType(org.ojai.Value.Type type)
type - the Type to testtrue if the specified type is a supported Type for '_id' field,
otherwise, false.public static java.lang.String asString(org.ojai.Value in)
in - public static byte[] encodeStringBinary(java.lang.String in)
in - the binary encoded string to encodepublic static java.nio.ByteBuffer encode(org.ojai.Value in)
in - the Value to encodeorg.ojai.exceptions.EncodingException - if the input Value is not a supported typepublic static byte[] encodeAsBytes(org.ojai.Value in)
in - the Value to encodeorg.ojai.exceptions.EncodingException - if the input Value is not a supported typepublic static org.ojai.Value decode(byte[] in)
in - byte array containing the encoded Valueorg.ojai.exceptions.DecodingException - if the input byte array does not contain a supported typepublic static org.ojai.Value decode(java.nio.ByteBuffer in)
in - ByteBuffer containing the encoded Valueorg.ojai.exceptions.DecodingException - if the input ByteBuffer does not contain a supported typepublic static java.nio.ByteBuffer encode(java.lang.String in)
in - the String to encodepublic static byte[] encodeAsBytes(java.lang.String in)
in - the String to encodepublic static java.lang.String decodeString(byte[] in)
in - byte array containing the encoded Stringorg.ojai.exceptions.DecodingException - if the input byte array does not contain a STRING valuepublic static java.lang.String decodeString(java.nio.ByteBuffer in)
in - ByteBuffer containing the encoded Stringorg.ojai.exceptions.DecodingException - if the input ByteBuffer does not contain a STRING valuepublic static byte[] encodeAsBytes(byte[] in)
in - the byte array containing the BINARY datapublic static byte[] decodeBytes(byte[] in)
in - byte array containing the encoded BINARY Valueorg.ojai.exceptions.DecodingException - if the input byte array does not contain a BINARY valuepublic static java.nio.ByteBuffer encode(java.nio.ByteBuffer in)
in - the ByteBuffer containing the BINARY datapublic static byte[] encodeAsBytes(java.nio.ByteBuffer in)
in - the ByteBuffer containing the BINARY datapublic static java.nio.ByteBuffer decodeBinary(java.nio.ByteBuffer in)
in - ByteBuffer containing the encoded BINARY Valueorg.ojai.exceptions.DecodingException - if the input ByteBuffer does not contain a BINARY value.