Interface AttributeValueToRepresentationStrategy
- All Known Implementing Classes:
DefaultAttributeValueToRepresentationStrategy,RenderingAttributeValueToRepresentationStrategy
public interface AttributeValueToRepresentationStrategy
Interface that specifies the different ways to transform an attribute, depending on its type, to its
corresponding representation.
-
Method Summary
Modifier and TypeMethodDescriptiongetCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a collection stored in an attribute.getLocalizedCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a localized collection value stored in an attribute.getLocalizedGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a localized value stored in an attribute.getSimpleGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve a Supplier that can be used to get the representation of the value of an attribute.
-
Method Details
-
getSimpleGetter
Supplier<Object> getSimpleGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve a Supplier that can be used to get the representation of the value of an attribute. This representation is generated by applying the provided transformation function.- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the value that will be transformed.transformationFunction- The function that will be used to transform the value into the expected object.- Returns:
- A
Supplier. Use get() to retrieve the transformed object.
-
getCollectionGetter
Supplier<Object> getCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a collection stored in an attribute. This representation is generated by leveraging the provided transformation function.- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the collection that will be transformed.transformationFunction- The function that will be used to transform the collection into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed collection.
-
getLocalizedGetter
Supplier<Object> getLocalizedGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a localized value stored in an attribute. This representation is generated by leveraging the provided transformation function.- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the localized value that will be transformed.transformationFunction- The function that will be used to transform the localized value into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed localized value.
-
getLocalizedCollectionGetter
Supplier<Object> getLocalizedCollectionGetter(AttributeDescriptorModel attribute, ItemModel sourceModel, Function<Object, Object> transformationFunction) This function is used to retrieve aSupplierthat can be used to get the representation of a localized collection value stored in an attribute. This representation is generated by leveraging the provided transformation function.- Parameters:
attribute- The object describing the attribute whose value will be transformed.sourceModel- The model containing the localized collection value that will be transformed.transformationFunction- The function that will be used to transform the localized collection value into the expected representation.- Returns:
- A
Supplier. Use get() to retrieve the transformed localized collection value.
-