Package snap.props

Class StringCodec

java.lang.Object
snap.props.StringCodec

public class StringCodec extends Object
A class to convert common types to/from Strings.
  • Field Details

  • Constructor Details

    • StringCodec

      public StringCodec()
  • Method Details

    • isCodeable

      public boolean isCodeable(Object anObj)
      Returns whether given object can be converted to/from String.
    • isCodeableClass

      public boolean isCodeableClass(Class<?> aClass)
      Returns whether given object can be converted to/from String.
    • getCodeableClasses

      public Set<Class<?>> getCodeableClasses()
      Returns set of classes that can be converted to/from String.
    • getCodeableClassesImpl

      protected Set<Class<?>> getCodeableClassesImpl()
      Returns set of classes that can be converted to/from String.
    • codeString

      public String codeString(Object anObj)
      Returns a String for given object.
    • decodeString

      public <T> T decodeString(String aString, Class<T> aClass)
      Returns an Object for given String and class.
    • getStringArrayForString

      public static String[] getStringArrayForString(String aStr)
      Returns an array of String values for given comma separated string.
    • getStringForDoubleArray

      public String getStringForDoubleArray(double[] theValues)
      Return string for double array.
    • getDoubleArrayForString

      public static double[] getDoubleArrayForString(String aStr)
      Returns an array of double values for given comma separated string.