Class ConversionHelper


  • public class ConversionHelper
    extends Object
    Helper class for converting data types.
    • 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.
      • quotedOrNull

        public static String quotedOrNull​(String s)
        Quoted string or null.
      • toString

        public static <T> String toString​(List<T> list)
        List or null to string.
      • toString

        public static <T1,​T2> String toString​(Map<T1,​T2> map)
        Map or null to string.