|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<XAttrCodec> org.apache.hadoop.fs.XAttrCodec
@InterfaceAudience.Public @InterfaceStability.Stable public enum XAttrCodec
The value of XAttr
is byte[], this class is to
covert byte[] to some kind of string representation or convert back.
String representation is convenient for display and input. For example
display in screen as shell response and json response, input as http
or shell parameter.
Enum Constant Summary | |
---|---|
BASE64
Value encoded as base64 string is prefixed with 0s. |
|
HEX
Value encoded as hexadecimal string is prefixed with 0x. |
|
TEXT
Value encoded as text string is enclosed in double quotes (\"). |
Method Summary | |
---|---|
static byte[] |
decodeValue(String value)
Decode string representation of a value and check whether it's encoded. |
static String |
encodeValue(byte[] value,
XAttrCodec encoding)
Encode byte[] value to string representation with encoding. |
static XAttrCodec |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static XAttrCodec[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final XAttrCodec TEXT
public static final XAttrCodec HEX
public static final XAttrCodec BASE64
Method Detail |
---|
public static XAttrCodec[] values()
for (XAttrCodec c : XAttrCodec.values()) System.out.println(c);
public static XAttrCodec valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static byte[] decodeValue(String value) throws IOException
value
- string representation of the value.
IOException
public static String encodeValue(byte[] value, XAttrCodec encoding) throws IOException
value
- byte[] valueencoding
-
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |