Interface ValueConversionContext<P extends PersistentProperty<P>>


public interface ValueConversionContext<P extends PersistentProperty<P>>
The ValueConversionContext provides access to the store-specific PersistentProperty and allows to call the store-default conversion through the read/write methods.

Store implementations should provide their own flavor of ValueConversionContext enhancing the existing API, implementing delegates for read(Object, TypeInformation), write(Object, TypeInformation).

Author:
Christoph Strobl, Oliver Drotbohm
  • Method Details

    • getProperty

      P getProperty()
      Return the PersistentProperty to be handled.
      Returns:
      will never be null.
    • write

      @Nullable default Object write(@Nullable Object value)
      Write to whatever type is considered best for the given source.
      Parameters:
      value -
      Returns:
    • write

      @Nullable default <T> T write(@Nullable Object value, Class<T> target)
      Write as the given type.
      Parameters:
      value - can be null.
      target - must not be null.
      Returns:
      can be null.
    • write

      @Nullable default <T> T write(@Nullable Object value, TypeInformation<T> target)
      Write as the given type.
      Parameters:
      value - can be null.
      target - must not be null.
      Returns:
      can be null.
    • read

      @Nullable default Object read(@Nullable Object value)
      Reads the value into the type of the current property.
      Parameters:
      value - can be null.
      Returns:
      can be null.
    • read

      @Nullable default <T> T read(@Nullable Object value, Class<T> target)
      Reads the value as the given type.
      Parameters:
      value - can be null.
      target - must not be null.
      Returns:
      can be null.
    • read

      @Nullable default <T> T read(@Nullable Object value, TypeInformation<T> target)
      Reads the value as the given type.
      Parameters:
      value - can be null.
      target - must not be null.
      Returns:
      can be null.