Class StringConverter


  • public final class StringConverter
    extends java.lang.Object
    Simple converter from string source to target type. Supports:
    • String
    • Boolean
    • Integer
    • Double
    • Short
    • Byte
    • Enum type value (when target type is exact enum type and string is enum constant)
    • Enum recognition (when target type is generic Enum and string is "fullEnumClass.constantName"
    Also, could parse comma-separated lists to arrays of any of the above types (String[], Boolean[] etc).

    Special support for EnumSet: it must be a list of fully qualified enum values (enumClass.enumValue).

    Since:
    27.04.2018
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <V> V convert​(java.lang.Class<V> target, java.lang.String value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • convert

        public static <V> V convert​(java.lang.Class<V> target,
                                    java.lang.String value)