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
  • 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 converter registered for the given type, path combination or null if none defined.
      Type Parameters:
      DV -
      SV -
      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 present for the given type/path combination.
    • isEmpty

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

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