public final class EidasStringUtil extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBytesFromBase64(String base64String)
Decodes the given
DatatypeConverter String into a byte array. |
static String |
decodeStringFromBase64(String base64String)
Decodes the given
DatatypeConverter String into a byte array. |
static String |
encodeToBase64(byte[] bytes)
DatatypeConverter encodes the given byte array into a BASE64 string. |
static String |
encodeToBase64(String value)
DatatypeConverter encodes the given normal string into a BASE64 string. |
static byte[] |
getBytes(String value) |
static List<String> |
getDistinctValues(String values)
Splits a string which contains a semicolon separated list of values into a list of values
Only the first occurrence of each value will be present in the return list.
|
static List<String> |
getTokens(String tokens)
Splits a string that contains several tokens separated by a delimiter defined in
STRING_SPLITTER |
static String |
toString(byte[] bytes) |
@Nonnull public static byte[] decodeBytesFromBase64(@Nonnull String base64String)
DatatypeConverter
String into a byte array.base64String
- the BASE64 String to be decoded.DatatypeConverter.parseBase64Binary(java.lang.String)
@Nonnull public static String decodeStringFromBase64(@Nonnull String base64String)
DatatypeConverter
String into a byte array.base64String
- the BASE64 String to be decoded.DatatypeConverter.parseBase64Binary(java.lang.String)
@Nonnull public static String encodeToBase64(@Nonnull byte[] bytes)
DatatypeConverter
encodes the given byte array into a BASE64 string.bytes
- the byte array to be encoded.DatatypeConverter.printBase64Binary(byte[])
@Nonnull public static String encodeToBase64(@Nonnull String value)
DatatypeConverter
encodes the given normal string into a BASE64 string.value
- the value to be encoded.DatatypeConverter.printBase64Binary(byte[])
@Nonnull public static byte[] getBytes(@Nonnull String value)
value
- input String@Nonnull public static String toString(@Nonnull byte[] bytes)
bytes
- input byte arraypublic static List<String> getTokens(String tokens)
STRING_SPLITTER
tokens
- the string containing tokensList
containing the tokens or an empty list if no token is found.@Nonnull public static List<String> getDistinctValues(@Nullable String values)
values
- a string containing several chunks separated by ;Copyright © 2020. All Rights Reserved.