Class TemplateMapping
- java.lang.Object
-
- com.broadleafcommerce.metadata.dsl.core.Mapping<TemplateMapping>
-
- com.broadleafcommerce.metadata.dsl.core.extension.mappings.TemplateMapping
-
- All Implemented Interfaces:
Copyable<TemplateMapping>,Serializable
public class TemplateMapping extends Mapping<TemplateMapping> implements Serializable
An implementation ofMappingfor transforming a text property with a template.- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TemplateMapping()TemplateMapping(TemplateMapping mapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)TemplateMappingcopy()booleanequals(Object o)StringgetPath()The name of the text property to transform.StringgetTemplate()The template to apply to the text property.inthashCode()TemplateMappingpath(String path)Sets the text property path to transform.TemplateMappingtemplate(String template)Sets the template to apply to the text property, for example, "Clone {name}"TemplateMappingtemplateTransform(String path, String template)Sets the text property path and the template value.
-
-
-
Constructor Detail
-
TemplateMapping
public TemplateMapping()
-
TemplateMapping
public TemplateMapping(TemplateMapping mapping)
-
-
Method Detail
-
copy
public TemplateMapping copy()
- Specified by:
copyin interfaceCopyable<TemplateMapping>- Returns:
- a deep copy of this instance
-
path
public TemplateMapping path(String path)
Sets the text property path to transform.- Parameters:
path- the property path- Returns:
- the mapping
-
template
public TemplateMapping template(String template)
Sets the template to apply to the text property, for example, "Clone {name}"- Parameters:
template- the template- Returns:
- the mapping
-
templateTransform
public TemplateMapping templateTransform(String path, String template)
Sets the text property path and the template value.- Parameters:
path- the property pathtemplate- the template- Returns:
- the mapping
-
getPath
public String getPath()
The name of the text property to transform.
-
getTemplate
public String getTemplate()
The template to apply to the text property.
-
equals
public boolean equals(Object o)
- Overrides:
equalsin classMapping<TemplateMapping>
-
canEqual
protected boolean canEqual(Object other)
- Overrides:
canEqualin classMapping<TemplateMapping>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classMapping<TemplateMapping>
-
-