Class TypeConverter

java.lang.Object
arez.persist.runtime.TypeConverter

public final class TypeConverter extends Object
A converter that encodes properties for a specific type.
  • Constructor Details

  • Method Details

    • decode

      public <A, E> A decode(@Nonnull String key, @Nullable E encoded)
      Decode encoded value into form used by the application.
      Type Parameters:
      A - the type of the value.
      E - the type of the encoded value.
      Parameters:
      key - the property name.
      encoded - the encoded form of the value.
      Returns:
      the value.
    • encode

      public <A, E> E encode(@Nonnull String key, @Nullable A value)
      Encode value into form used by the storage system.
      Type Parameters:
      A - the type of the value.
      E - the type of the encoded value.
      Parameters:
      key - the property name.
      value - the decoded value.
      Returns:
      the encoded form of the value.