Class TypeConverter<E,I>

java.lang.Object
org.exoplatform.commons.serialization.api.TypeConverter<E,I>
Direct Known Subclasses:
DefaultTypeConverter

public abstract class TypeConverter<E,I> extends Object
A type converter that performs a bidirectional conversion between an external type and an internal type. The converter only assure conversion of non null values.
  • Constructor Details

    • TypeConverter

      public TypeConverter()
  • Method Details

    • write

      public abstract I write(E external) throws Exception
      Converts an external value to an internal value.
      Parameters:
      external - the external value
      Returns:
      the the internal value
      Throws:
      Exception - any conversion exception
    • read

      public abstract E read(I internal) throws Exception
      Converts an internal value to an external value.
      Parameters:
      internal - the internal value
      Returns:
      the external value
      Throws:
      Exception - any conversion exception