Class SimpleConverter<T>

java.lang.Object
org.cyclopsgroup.caff.conversion.SimpleConverter<T>
Type Parameters:
T - Type of value to convert from/to
All Implemented Interfaces:
Converter<T>

public class SimpleConverter<T> extends Object implements Converter<T>
Converter implementation that does naive conversion for String, CharSequence, char[], BigDecimal, BigInteger and all primitives
Author:
Jiaqi Guo
  • Constructor Details

    • SimpleConverter

      public SimpleConverter(Class<T> type)
      Parameters:
      type - Type of value to convert from/to
  • Method Details

    • fromCharacters

      public T fromCharacters(CharSequence text)
      Specified by:
      fromCharacters in interface Converter<T>
      Parameters:
      text - Character sequence form of value
      Returns:
      Converted result
    • toCharacters

      public CharSequence toCharacters(T value)
      Specified by:
      toCharacters in interface Converter<T>
      Parameters:
      value - Object instance
      Returns:
      Text form of value