Class CollectionToRepresentationConverter
- java.lang.Object
-
- de.hybris.platform.cmsfacades.cmsitems.attributeconverters.CollectionToRepresentationConverter
-
- All Implemented Interfaces:
AttributeValueToRepresentationConverter<java.util.Collection<java.lang.Object>,java.util.Collection<java.lang.Object>>
public class CollectionToRepresentationConverter extends java.lang.Object implements AttributeValueToRepresentationConverter<java.util.Collection<java.lang.Object>,java.util.Collection<java.lang.Object>>
ThisAttributeValueToRepresentationConverteris invoked while converting aCMSItemModelinto 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 Constructor Description CollectionToRepresentationConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<java.lang.Object>convert(AttributeDescriptorModel attribute, java.util.Collection<java.lang.Object> collection, java.util.function.Function<java.lang.Object,java.lang.Object> transformationFunction)Converts an item of typeT, described by the providedAttributeDescriptorModel, into a new object of typeSby applying the provided transformation function.protected ValidationErrorsProvidergetValidationErrorsProvider()voidsetValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
-
-
Method Detail
-
convert
public java.util.Collection<java.lang.Object> convert(AttributeDescriptorModel attribute, java.util.Collection<java.lang.Object> collection, java.util.function.Function<java.lang.Object,java.lang.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<java.util.Collection<java.lang.Object>,java.util.Collection<java.lang.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.
-
getValidationErrorsProvider
protected ValidationErrorsProvider getValidationErrorsProvider()
-
setValidationErrorsProvider
public void setValidationErrorsProvider(ValidationErrorsProvider validationErrorsProvider)
-
-