Class CollectionToRepresentationConverter
java.lang.Object
de.hybris.platform.cmsfacades.cmsitems.attributeconverters.CollectionToRepresentationConverter
- All Implemented Interfaces:
AttributeValueToRepresentationConverter<Collection<Object>,Collection<Object>>
public class CollectionToRepresentationConverter
extends Object
implements AttributeValueToRepresentationConverter<Collection<Object>,Collection<Object>>
This
AttributeValueToRepresentationConverter is invoked while converting a CMSItemModel
into its representation. It's used to convert a Collection of items into its representation (which is a collection of converted items
themselves).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbuildConversionException(AttributeDescriptorModel attribute, Object value, ConversionException e, Integer index) convert(AttributeDescriptorModel attribute, Collection<Object> collection, Function<Object, Object> transformationFunction) Converts an item of typeT, described by the providedAttributeDescriptorModel, into a new object of typeSby applying the provided transformation function.protected ValidationErrorsProvidervoidsetValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
Constructor Details
-
CollectionToRepresentationConverter
public CollectionToRepresentationConverter()
-
-
Method Details
-
convert
public Collection<Object> convert(AttributeDescriptorModel attribute, Collection<Object> collection, Function<Object, Object> transformationFunction) Description copied from interface:AttributeValueToRepresentationConverterConverts an item of typeT, described by the providedAttributeDescriptorModel, into a new object of typeSby 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.- Specified by:
convertin interfaceAttributeValueToRepresentationConverter<Collection<Object>,Collection<Object>> - Parameters:
attribute- A model describing the attributecollection- The item to converttransformationFunction- Function that will be used to transform the provided item.- Returns:
- an instance of
S, converted fromTby leveraging the provided transformationFunction.
-
buildConversionException
protected void buildConversionException(AttributeDescriptorModel attribute, Object value, ConversionException e, Integer index) -
getValidationErrorsProvider
-
setValidationErrorsProvider
-