public class HBaseEncoderUtil extends Object
Object
to Byte
encoding. This class is used to ensure that HBase
keys have the same size, and provides an uniformized API to encode strings and EReference
.Modifier and Type | Field and Description |
---|---|
static int |
UUID_LENGTH
Expected length (in
bytes ) of stored elements. |
static char |
VALUE_SEPERATOR_DEFAULT
The default separator used to serialize
Collection s. |
Constructor and Description |
---|
HBaseEncoderUtil() |
Modifier and Type | Method and Description |
---|---|
static byte[] |
toBytes(String[] strings)
Encodes an array of
String s into an array of bytes that can be stored in the database. |
static byte[] |
toBytesReferences(String[] strings)
Encodes the provided
String array into an array of bytes that can be stored in the database. |
static String[] |
toStrings(byte[] bytes)
Decodes an array of
bytes into an array of String s. |
static String[] |
toStringsReferences(byte[] value)
|
public static final int UUID_LENGTH
bytes
) of stored elements.public static final char VALUE_SEPERATOR_DEFAULT
Collection
s.public static String[] toStringsReferences(byte[] value)
value
- the HBase value to decodeString
s representing the EReference
s decoded from the databaseNullPointerException
- if the given value
is nullIllegalArgumentException
- if the length of value
is not a multiple of UUID_LENGTH
toBytesReferences(String[])
public static byte[] toBytesReferences(String[] strings)
String
array into an array of bytes
that can be stored in the database.strings
- an array of String
s representing the EReference
s to encode.bytes
NullPointerException
- if the value to encode is null
toStringsReferences(byte[])
public static byte[] toBytes(String[] strings)
String
s into an array of bytes
that can be stored in the database.strings
- the array to encodebyte
arraytoStrings(byte[])
public static String[] toStrings(byte[] bytes)
bytes
into an array of String
s.bytes
- the byte
array to decodeString
arrayNullPointerException
- if the given array is null
toBytes(String[])
Copyright © 2013–2017 Atlanmod INRIA LINA Mines Nantes. All rights reserved.