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 of Mapping for transforming a text property with a template.
Author:
Nick Crum (ncrum)
See Also:
  • Constructor Details

    • TemplateMapping

      public TemplateMapping()
    • TemplateMapping

      public TemplateMapping(TemplateMapping mapping)
  • Method Details

    • copy

      public TemplateMapping copy()
      Specified by:
      copy in interface Copyable<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 path
      template - 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:
      equals in class Mapping<TemplateMapping>
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Mapping<TemplateMapping>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Mapping<TemplateMapping>