- java.lang.Object
-
- java.lang.Enum<BaseEncoder>
-
- com.appslandia.common.base.BaseEncoder
-
- All Implemented Interfaces:
Serializable,Comparable<BaseEncoder>
public enum BaseEncoder extends Enum<BaseEncoder>
- Author:
- Loc Ha
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BASE64BASE64_MIMEBASE64_MIME_NPBASE64_NPBASE64_URLBASE64_URL_NP
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]decode(String encoded)Stringencode(byte[] message)static BaseEncodervalueOf(String name)Returns the enum constant of this type with the specified name.static BaseEncoder[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BASE64
public static final BaseEncoder BASE64
-
BASE64_NP
public static final BaseEncoder BASE64_NP
-
BASE64_URL
public static final BaseEncoder BASE64_URL
-
BASE64_URL_NP
public static final BaseEncoder BASE64_URL_NP
-
BASE64_MIME
public static final BaseEncoder BASE64_MIME
-
BASE64_MIME_NP
public static final BaseEncoder BASE64_MIME_NP
-
-
Method Detail
-
values
public static BaseEncoder[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BaseEncoder c : BaseEncoder.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BaseEncoder valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
encode
public String encode(byte[] message)
-
decode
public byte[] decode(String encoded) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-