Class CustomContentField

java.lang.Object
com.broadleafcommerce.content.domain.CustomContentField
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class CustomContentField extends Object implements Serializable, com.broadleafcommerce.data.tracking.core.ContextStateAware
Represents the definition of a FieldData. This includes its type and other metadata.
See Also:
  • Constructor Details

    • CustomContentField

      public CustomContentField()
  • Method Details

    • getId

      public String getId()
      A unique id for the field.
      Returns:
      the unique id for the field
    • getName

      public String getName()
      A unique name for the custom content field.
      Returns:
      a unique name for the custom content field
    • getType

      public String getType()
      The type of this custom content field
      Returns:
      the type of this field
    • getUrl

      public String getUrl()
      Configure the read endpoint for the lookup. This endpoint tells the lookup where it can go to retrieve the options the user chooses from.
      Returns:
      the read endpoint for the lookup
    • getHydrateUrl

      public String getHydrateUrl()
      Configures the hydration endpoint for the lookup. This endpoint tells the lookup where to can go to retrieve the hydrated option for the current value. This endpoint is used when the component mounts to hydrate the option associated with the stored value.
      Returns:
      the hydration endpoint for the lookup
    • getLabelKey

      public String getLabelKey()
      Sets the name of the label key. It can contain the template to create more complicated labels. For example to display the label like `Name (id)` the template like `${name} - (${id})` can be used.
      Returns:
      the label key
    • getValueKey

      public String getValueKey()
      Sets the name of the value key.
      Returns:
      this
    • isMulti

      public boolean isMulti()
      Configures whether the field supports multi-selection.
      Returns:
      whether the field supports multi-selection
    • getOptions

      public List<CustomContentFieldOption> getOptions()
      The options for the field. This is used when the type is ENUM.
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional attributes needed to further define this field
      Returns:
      additional attributes needed to further define this field
    • getContextState

      public com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState getContextState()
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      getContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Returns:
      a subset of Tracking information to expose the context state for this object
    • setId

      public void setId(String id)
      A unique id for the field.
      Parameters:
      id - the unique id for the field
    • setName

      public void setName(String name)
      A unique name for the custom content field.
      Parameters:
      name - a unique name for the custom content field
    • setType

      public void setType(String type)
      The type of this custom content field
      Parameters:
      type - the type of this field
    • setUrl

      public void setUrl(String url)
      Configure the read endpoint for the lookup. This endpoint tells the lookup where it can go to retrieve the options the user chooses from.
      Parameters:
      url - the read endpoint for the lookup
    • setHydrateUrl

      public void setHydrateUrl(String hydrateUrl)
      Configures the hydration endpoint for the lookup. This endpoint tells the lookup where to can go to retrieve the hydrated option for the current value. This endpoint is used when the component mounts to hydrate the option associated with the stored value.
      Parameters:
      hydrateUrl - the hydration endpoint for the lookup
    • setLabelKey

      public void setLabelKey(String labelKey)
      Sets the name of the label key. It can contain the template to create more complicated labels. For example to display the label like `Name (id)` the template like `${name} - (${id})` can be used.
      Parameters:
      labelKey - the label key
    • setValueKey

      public void setValueKey(String valueKey)
      Sets the name of the value key.
      Parameters:
      valueKey - the label key
    • setMulti

      public void setMulti(boolean multi)
      Configures whether the field supports multi-selection.
      Parameters:
      multi - whether the field supports multi-selection
    • setOptions

      public void setOptions(List<CustomContentFieldOption> options)
      The options for the field. This is used when the type is ENUM.
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional attributes needed to further define this field
      Parameters:
      attributes - additional information used by this field
    • setContextState

      public void setContextState(com.broadleafcommerce.data.tracking.core.filtering.business.domain.ContextState contextState)
      A subset of Tracking information to expose the context state for this object.
      Specified by:
      setContextState in interface com.broadleafcommerce.data.tracking.core.ContextStateAware
      Parameters:
      contextState - a subset of Tracking information to expose the context state for this object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object