Package com.six.timapi
Class ConversionHelper
- java.lang.Object
-
- com.six.timapi.ConversionHelper
-
public class ConversionHelper extends Object
Helper class for converting data types.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
base64StringToByte(String s)
Convert String in base64 notation to byte[].static String
byteOrNullToBase64String(byte[] bytes)
Convert byte[] to String in base64 notation.static String
byteOrNullToHexString(byte[] bytes)
Convert byte[] to String in hex notation.static String
byteToBase64String(byte[] bytes)
Convert byte[] to String in base64 notation.static String
byteToHexString(byte[] bytes)
Convert byte[] to String in hex notation.static byte[]
hexStringToByte(String string)
Convert String in hex notation to byte[].static String
quotedOrNull(String s)
Quoted string or null.static <T> String
toString(List<T> list)
List or null to string.static <T1,T2>
StringtoString(Map<T1,T2> map)
Map or null to string.
-
-
-
Method Detail
-
byteToHexString
public static String byteToHexString(byte[] bytes)
Convert byte[] to String in hex notation.
-
byteOrNullToHexString
public static String byteOrNullToHexString(byte[] bytes)
Convert byte[] to String in hex notation. If bytes is null returns empty string.
-
byteToBase64String
public static String byteToBase64String(byte[] bytes)
Convert byte[] to String in base64 notation.
-
byteOrNullToBase64String
public static String byteOrNullToBase64String(byte[] bytes)
Convert byte[] to String in base64 notation. If bytes is null returns empty string.
-
hexStringToByte
public static byte[] hexStringToByte(String string)
Convert String in hex notation to byte[]. Invalid characters are assumed to be 0.
-
base64StringToByte
public static byte[] base64StringToByte(String s)
Convert String in base64 notation to byte[]. Invalid characters are assumed to be 0.
-
-