Package org.openiam.util
Class StringUtil
- java.lang.Object
-
- org.openiam.util.StringUtil
-
public class StringUtil extends Object
Helper class called between Lists of Strings and Arrays of Strings.- Author:
- Suneet Shah
-
-
Constructor Summary
Constructors Constructor Description StringUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
attachAndTruncate(int maxSize, String main, String suffix)
attach and truncate main part if concantinated string more than maxSizestatic String
fromBase64(String encoded)
static String
toBase64(String plain)
-
-
-
Method Detail
-
fromBase64
public static String fromBase64(String encoded)
- Parameters:
encoded
- Base64 encoded String to be decoded- Returns:
- Decoded string, or null if input was null or decoding failed
-
toBase64
public static String toBase64(String plain)
- Parameters:
plain
- String to be Base64 encoded- Returns:
- Base64 encoded String, or null if input was null or encoding failed
-
attachAndTruncate
public static String attachAndTruncate(int maxSize, String main, String suffix) throws IllegalArgumentException
attach and truncate main part if concantinated string more than maxSize- Parameters:
maxSize
- - maxSize of total stringmain
- - main part, chars will be truncated from this stringsuffix
- - suffix is immutable.- Returns:
- - contantinated string with length not more than maxSize
- Throws:
IllegalArgumentException
-
-