Package com.cyberark.conjur.util
Class TextUtils
- java.lang.Object
-
- com.cyberark.conjur.util.TextUtils
-
public final class TextUtils extends Object
A couple of String helpers.
-
-
Constructor Summary
Constructors Constructor Description TextUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]getBytes(String data, String charset)Converts the specified string to a byte array.static StringgetString(byte[] data, int offset, int length, String charset)Converts the byte array of characters to a string.static booleanisBlank(CharSequence s)static booleanisEmpty(CharSequence s)static Stringjoin(CharSequence glue, CharSequence[] parts)
-
-
-
Method Detail
-
join
public static String join(CharSequence glue, CharSequence[] parts)
-
isEmpty
public static boolean isEmpty(CharSequence s)
-
isBlank
public static boolean isBlank(CharSequence s)
-
getString
public static String getString(byte[] data, int offset, int length, String charset)
Converts the byte array of characters to a string. If the specified charset is not supported, default system encoding is used.- Parameters:
data- the byte array to be encodedoffset- the index of the first byte to encodelength- the number of bytes to encodecharset- the desired character encoding- Returns:
- The result of the conversion.
-
getBytes
public static byte[] getBytes(String data, String charset)
Converts the specified string to a byte array. If the charset is not supported the default system charset is used.- Parameters:
data- the string to be encodedcharset- the desired character encoding- Returns:
- The resulting byte array.
-
-