Interface AttributeContentConverter<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object convertDataToModel​(T attribute, java.lang.Object source)
      Converts a serializable representation to a property value in case that the predicate defined is true for a given attribute descriptor.
      java.lang.Object convertModelToData​(T attribute, java.lang.Object source)
      Converts a property value to a serializable representation in case that the predicate defined is true for a given attribute descriptor.
      java.util.function.Predicate<T> getConstrainedBy()
      Returns the predicate that constrains the converter.
    • Method Detail

      • getConstrainedBy

        java.util.function.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

        java.lang.Object convertModelToData​(T attribute,
                                            java.lang.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

        java.lang.Object convertDataToModel​(T attribute,
                                            java.lang.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.