Interface TypeHandler<T>

Type Parameters:
T - type of field to handle
All Known Implementing Classes:
AbstractTypeHandler

public interface TypeHandler<T>
Type handler contract to manage java types.
Author:
Guillaume CHAUVET
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(Class<?> type)
    Check if we can handle the data type
    read(String data, String format)
    process an input string to a concrete field value
    write(T data, String format)
    transform a field value to an output string
  • Method Details

    • accept

      boolean accept(Class<?> type)
      Check if we can handle the data type
      Parameters:
      type - to check
      Returns:
      true if handlable
    • read

      T read(String data, String format)
      process an input string to a concrete field value
      Parameters:
      data - string of data
      format - of data, null otherwise
      Returns:
      instance of the type
    • write

      String write(T data, String format)
      transform a field value to an output string
      Parameters:
      data - the type with data
      format - of data, null otherwise
      Returns:
      string content of type