Interface AttributeValueToRepresentationConverter<T,​S>

  • Type Parameters:
    T - the type of the attribute to convert.
    S - the type of the output to produce.
    All Known Implementing Classes:
    CollectionToRepresentationConverter
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface AttributeValueToRepresentationConverter<T,​S>
    This interface is used to transform an attribute, described by its AttributeDescriptorModel, leveraging a transformation function. This interface can be useful to transform lists or other types of collections.
    • Method Detail

      • convert

        S convert​(AttributeDescriptorModel attribute,
                  T item,
                  java.util.function.Function<java.lang.Object,​java.lang.Object> transformationFunction)
        Converts an item of type T, described by the provided AttributeDescriptorModel, into a new object of type S by applying the provided transformation function. This function can be useful to transform lists or other types of collections, where the transformation function has to be applied individually to each element of the collection.
        Parameters:
        attribute - A model describing the attribute
        item - The item to convert
        transformationFunction - Function that will be used to transform the provided item.
        Returns:
        an instance of S, converted from T by leveraging the provided transformationFunction.