Interface AttributeContentConverter<T>

Type Parameters:
T - type parameter. The type is used as a Predicate argument as well as in convertModelToData and convertModelToData methods.
All Known Implementing Classes:
BaseAttributeContentConverter, DefaultAttributeContentConverter, EnumAttributeContentConverter, LinkTargetAttributeContentConverter, VersionAttributeContentConverter

public interface AttributeContentConverter<T>
Generic interface that represents the Attribute Converter<Object, Object> with its respective Predicate<T>.
  • Method Summary

    Modifier and Type
    Method
    Description
    convertDataToModel(T attribute, Object source)
    Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.
    convertModelToData(T attribute, Object source)
    Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.
    Returns the predicate that constrains the converter.
  • Method Details

    • getConstrainedBy

      Predicate<T> getConstrainedBy()
      Returns the predicate that constrains the converter. This predicate will be tested against a given attribute descriptor and if this predicate is true, then it applies the conversion,
      Returns:
      the predicate related with the converter. Never null.
    • convertModelToData

      Object convertModelToData(T attribute, Object source)
      Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.
      Parameters:
      attribute - the object describing the source
      source - the persistent source described by the attribute that needs be converted to some serializable representation
      Returns:
      the converter instance. Never null.
    • convertDataToModel

      Object convertDataToModel(T attribute, Object source)
      Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.
      Parameters:
      attribute - the object describing the source
      source - the serializable representation described by the attribute that needs be converted to some persistent property
      Returns:
      the converter instance. Never null.