Class StringConverter

java.lang.Object
jodd.typeconverter.impl.StringConverter
All Implemented Interfaces:
TypeConverter<String>

public class StringConverter extends Object implements TypeConverter<String>
Converts given object to String. Conversion rules:
  • null value is returned as null
  • for CharSequence type returns toString value
  • Class returns cass name
  • char[] is used for creating string
  • arrays are converted to comma-separated list of toString values
  • Clob is converted
  • finally, toString() value is returned.
  • Constructor Details

    • StringConverter

      public StringConverter()
  • Method Details

    • convert

      public String convert(Object value)
      Description copied from interface: TypeConverter
      Converts object received as parameter into object of another class. For example, an Integer converter tries to convert given objects into target Integer object. Converters should try all reasonable ways of conversion into target object, depending on target type.
      Specified by:
      convert in interface TypeConverter<String>
      Parameters:
      value - object to convert from
      Returns:
      resulting object converted to target type