@API.Internal public class IdCodec extends Object
| Constructor and Description |
|---|
IdCodec() |
| Modifier and Type | Method and Description |
|---|---|
static 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(ByteBuffer in)
Decodes a Value from the provided ByteBuffer.
|
static ByteBuffer |
decodeBinary(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 String |
decodeString(byte[] in)
Decodes a STRING from the provided byte array.
|
static String |
decodeString(ByteBuffer in)
Decodes a STRING value from the provided ByteBuffer.
|
static ByteBuffer |
encode(ByteBuffer in)
Encodes a BINARY value into a ByteBuffer using the _id encoding scheme.
|
static ByteBuffer |
encode(String in)
Encodes a String into a ByteBuffer using the _id encoding scheme.
|
static 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(ByteBuffer in)
Encodes a BINARY value into a byte array using the _id encoding scheme.
|
static byte[] |
encodeAsBytes(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(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 String asString(org.ojai.Value in)
in - public static byte[] encodeStringBinary(String in)
in - the binary encoded string to encodepublic static 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(ByteBuffer in)
in - ByteBuffer containing the encoded Valueorg.ojai.exceptions.DecodingException - if the input ByteBuffer does not contain a supported typepublic static ByteBuffer encode(String in)
in - the String to encodepublic static byte[] encodeAsBytes(String in)
in - the String to encodepublic static 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 String decodeString(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 ByteBuffer encode(ByteBuffer in)
in - the ByteBuffer containing the BINARY datapublic static byte[] encodeAsBytes(ByteBuffer in)
in - the ByteBuffer containing the BINARY datapublic static ByteBuffer decodeBinary(ByteBuffer in)
in - ByteBuffer containing the encoded BINARY Valueorg.ojai.exceptions.DecodingException - if the input ByteBuffer does not contain a BINARY value.Copyright © 2016 Mapr Technologies, Inc.. All rights reserved.