Class CollectionMapping
- java.lang.Object
-
- com.broadleafcommerce.metadata.dsl.core.Mapping<CollectionMapping>
-
- com.broadleafcommerce.metadata.dsl.core.extension.mappings.CollectionMapping
-
- All Implemented Interfaces:
Copyable<CollectionMapping>
,Serializable
public class CollectionMapping extends Mapping<CollectionMapping> implements Serializable
An implementation ofMapping
for the members of a collection.- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CollectionMapping()
CollectionMapping(CollectionMapping mapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
CollectionMapping
clearMappings()
Clears the current set of collection mappings.CollectionMapping
copy()
boolean
equals(Object o)
List<Mapping<?>>
getMappings()
The list ofMapping
to apply to each collection member.String
getPath()
The name of the collection property to map.int
hashCode()
CollectionMapping
mapCollection(String path, Mapping<?>... mappings)
Sets the collection property and the set of mappings for the collection.CollectionMapping
mapCollection(String path, List<Mapping<?>> mappings)
Sets the collection property and the set of mappings for the collection.CollectionMapping
mapping(Mapping<?>... mappings)
Adds to the set of mappings to transform the collection.CollectionMapping
mappings(List<Mapping<?>> mappings)
Adds to the set of mappings to transform the collection.CollectionMapping
path(String path)
Sets the collection property to be mapped.
-
-
-
Constructor Detail
-
CollectionMapping
public CollectionMapping()
-
CollectionMapping
public CollectionMapping(CollectionMapping mapping)
-
-
Method Detail
-
copy
public CollectionMapping copy()
- Specified by:
copy
in interfaceCopyable<CollectionMapping>
- Returns:
- a deep copy of this instance
-
path
public CollectionMapping path(String path)
Sets the collection property to be mapped.- Parameters:
path
- the collection property- Returns:
- the mapping
-
mappings
public CollectionMapping mappings(List<Mapping<?>> mappings)
Adds to the set of mappings to transform the collection.- Parameters:
mappings
- the collection mappings- Returns:
- the mapping
-
mapping
public CollectionMapping mapping(Mapping<?>... mappings)
Adds to the set of mappings to transform the collection.- Parameters:
mappings
- the collection mappings- Returns:
- the mapping
-
clearMappings
public CollectionMapping clearMappings()
Clears the current set of collection mappings.- Returns:
- the mapping
-
mapCollection
public CollectionMapping mapCollection(String path, List<Mapping<?>> mappings)
Sets the collection property and the set of mappings for the collection.- Parameters:
path
- the pathmappings
- the set of mappings- Returns:
- the mapping
-
mapCollection
public CollectionMapping mapCollection(String path, Mapping<?>... mappings)
Sets the collection property and the set of mappings for the collection.- Parameters:
path
- the pathmappings
- the set of mappings- Returns:
- the mapping
-
getPath
public String getPath()
The name of the collection property to map.
-
getMappings
public List<Mapping<?>> getMappings()
The list ofMapping
to apply to each collection member.
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classMapping<CollectionMapping>
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqual
in classMapping<CollectionMapping>
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classMapping<CollectionMapping>
-
-