Interface ValueConverterRegistry<P extends PersistentProperty<P>>

All Known Implementing Classes:
SimplePropertyValueConverterRegistry

public interface ValueConverterRegistry<P extends PersistentProperty<P>>
A registry of property-specific value converters to convert only specific properties/values of an object.
Since:
2.7
Author:
Christoph Strobl
See Also:
  • Method Details

    • registerConverter

      void registerConverter(Class<?> type, String path, PropertyValueConverter<?,?,? extends ValueConversionContext<P>> converter)
      Register the PropertyValueConverter for the property of the given type.
      Parameters:
      type - the target type. Must not be null.
      path - the property name. Must not be null.
      converter - the converter to register. Must not be null.
    • getConverter

      @Nullable <DV, SV> PropertyValueConverter<DV,SV,? extends ValueConversionContext<P>> getConverter(Class<?> type, String path)
      Obtain the PropertyValueConverter registered for the given type, path combination or null if none defined.
      Type Parameters:
      DV - domain-specific type.
      SV - store-specific type.
      Parameters:
      type - the target type. Must not be null.
      path - the property name. Must not be null.
      Returns:
      null if no converter present for the given type/path combination.
    • containsConverterFor

      default boolean containsConverterFor(Class<?> type, String path)
      Check if a converter is registered for the given type, path combination.
      Parameters:
      type - the target type. Must not be null.
      path - the property name. Must not be null.
      Returns:
      false if no converter is present for the given type/path combination.
    • isEmpty

      boolean isEmpty()
      Check if converters are registered.
    • simple

      static <P extends PersistentProperty<P>> ValueConverterRegistry<P> simple()
      Obtain a simple ValueConverterRegistry.
      Type Parameters:
      P - PersistentProperty type.
      Returns:
      new instance of ValueConverterRegistry.