java.lang.Object
com.broadleafcommerce.catalog.domain.product.characteristic.Characteristic
All Implemented Interfaces:
com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable

public class Characteristic extends Object implements com.broadleafcommerce.data.tracking.core.ContextStateAware, Serializable
Represents a characteristic of a Product.
Since:
Catalog Service 2.2.0, Release Train 2.2.0
See Also:
  • Constructor Details

    • Characteristic

      public Characteristic()
  • Method Details

    • getId

      public String getId()
      Id of the characteristic.
    • getName

      public String getName()
      Name of the characteristic.
    • getFieldName

      public String getFieldName()
      Internal field name of the characteristic.
    • getDescription

      public String getDescription()
      Description for the characteristic.
    • getStartDate

      public Instant getStartDate()
      Start date for the characteristic.
    • getEndDate

      public Instant getEndDate()
      End date for the characteristic.
    • getValueType

      public String getValueType()
      Value type for the characteristic.
    • isConfigurable

      public boolean isConfigurable()
      Determines if the characteristic is configurable.
    • isTargetableInRuleBuilders

      public boolean isTargetableInRuleBuilders()
      Whether this characteristic should be targetable in rule-builders (e.g., by Offers and Content Items).
    • isTargetableForPricing

      public boolean isTargetableForPricing()
      Whether this characteristic should be targetable by pricing, e.g., a product's price should change depending on the value of this characteristic.
    • isUnique

      public boolean isUnique()
      Determines if the characteristic's value must be unique.
    • getMinCardinality

      public int getMinCardinality()
      Minimum cardinality for the characteristic.
    • getMaxCardinality

      public int getMaxCardinality()
      Maximum cardinality for the characteristic.
    • isExtensible

      public boolean isExtensible()
      Determines if the characteristic is extensible.
    • getValue

      public List<CharacteristicValue> getValue()
      List of values for the characteristic.
    • isShared

      public boolean isShared()
      Determines if the characteristic is shared between Specifications.
    • getDisplayOrder

      public Integer getDisplayOrder()
      Display order for the characteristic.
    • getValidationType

      public String getValidationType()
      The type of validation to apply to the characteristic's value.
    • getValidationRule

      public String getValidationRule()
      The validation rule to apply to the characteristic's value.
    • getErrorMessage

      public String getErrorMessage()
      The error message to display if the validation rule fails.
    • isTranslatable

      public boolean isTranslatable()
      Whether the values for this characteristic are translatable in the Admin UI.
    • getDisplayWidget

      public String getDisplayWidget()
      The name of the custom component that renders this characteristic.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • getTargetKey

      public Map<String,String> getTargetKey()
      Augmentation target keys.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • getParentCharacteristicId

      @Nullable public String getParentCharacteristicId()
      Since BusinessTypes can inherit characteristics from their parent/ancestor business types, there is a possibility for inherited characteristics to be edited and overridden.

      The ID of the parent characteristic that this characteristic is overriding. Only expected to be populated when inheritanceType is DefaultCharacteristicInheritanceType.OVERRIDDEN.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • getInheritanceType

      public String getInheritanceType()
      The type of inheritance that the characteristic falls under.
      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
      See Also:
    • isNarrowingEnabled

      public boolean isNarrowingEnabled()
      Determines if the characteristic's values should narrow as products are managed in child catalogs

      This functionality relies on ProductCharacteristicValue.isActive to determine if a characteristic value is active or inactive. If a characteristic value is active, it will be included in the narrowing process. If it is inactive, it will be excluded.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • isPlaceholder

      public boolean isPlaceholder()
      Whether this characteristic is allowed to have no values set. If false, at least one value must be specified.

      This is primarily used in advanced scenarios where a characteristic is being used as a placeholder for values that will be defined later, e.g., by an external system.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • 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
    • getAttributes

      public Map<String,Object> getAttributes()
      Additional custom attributes associated with extensions and complex value types, e.g., enum, variant option.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • setId

      public void setId(String id)
      Id of the characteristic.
    • setName

      public void setName(String name)
      Name of the characteristic.
    • setFieldName

      public void setFieldName(String fieldName)
      Internal field name of the characteristic.
    • setDescription

      public void setDescription(String description)
      Description for the characteristic.
    • setStartDate

      public void setStartDate(Instant startDate)
      Start date for the characteristic.
    • setEndDate

      public void setEndDate(Instant endDate)
      End date for the characteristic.
    • setValueType

      public void setValueType(String valueType)
      Value type for the characteristic.
    • setConfigurable

      public void setConfigurable(boolean configurable)
      Determines if the characteristic is configurable.
    • setTargetableInRuleBuilders

      public void setTargetableInRuleBuilders(boolean targetableInRuleBuilders)
      Whether this characteristic should be targetable in rule-builders (e.g., by Offers and Content Items).
    • setTargetableForPricing

      public void setTargetableForPricing(boolean targetableForPricing)
      Whether this characteristic should be targetable by pricing, e.g., a product's price should change depending on the value of this characteristic.
    • setUnique

      public void setUnique(boolean unique)
      Determines if the characteristic's value must be unique.
    • setMinCardinality

      public void setMinCardinality(int minCardinality)
      Minimum cardinality for the characteristic.
    • setMaxCardinality

      public void setMaxCardinality(int maxCardinality)
      Maximum cardinality for the characteristic.
    • setExtensible

      public void setExtensible(boolean extensible)
      Determines if the characteristic is extensible.
    • setValue

      public void setValue(List<CharacteristicValue> value)
      List of values for the characteristic.
    • setShared

      public void setShared(boolean shared)
      Determines if the characteristic is shared between Specifications.
    • setDisplayOrder

      public void setDisplayOrder(Integer displayOrder)
      Display order for the characteristic.
    • setValidationType

      public void setValidationType(String validationType)
      The type of validation to apply to the characteristic's value.
    • setValidationRule

      public void setValidationRule(String validationRule)
      The validation rule to apply to the characteristic's value.
    • setErrorMessage

      public void setErrorMessage(String errorMessage)
      The error message to display if the validation rule fails.
    • setTranslatable

      public void setTranslatable(boolean translatable)
      Whether the values for this characteristic are translatable in the Admin UI.
    • setDisplayWidget

      public void setDisplayWidget(String displayWidget)
      The name of the custom component that renders this characteristic.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • setTargetKey

      public void setTargetKey(Map<String,String> targetKey)
      Augmentation target keys.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • setParentCharacteristicId

      public void setParentCharacteristicId(@Nullable String parentCharacteristicId)
      Since BusinessTypes can inherit characteristics from their parent/ancestor business types, there is a possibility for inherited characteristics to be edited and overridden.

      The ID of the parent characteristic that this characteristic is overriding. Only expected to be populated when inheritanceType is DefaultCharacteristicInheritanceType.OVERRIDDEN.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • setInheritanceType

      public void setInheritanceType(String inheritanceType)
      The type of inheritance that the characteristic falls under.
      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
      See Also:
    • setNarrowingEnabled

      public void setNarrowingEnabled(boolean narrowingEnabled)
      Determines if the characteristic's values should narrow as products are managed in child catalogs

      This functionality relies on ProductCharacteristicValue.isActive to determine if a characteristic value is active or inactive. If a characteristic value is active, it will be included in the narrowing process. If it is inactive, it will be excluded.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • setPlaceholder

      public void setPlaceholder(boolean placeholder)
      Whether this characteristic is allowed to have no values set. If false, at least one value must be specified.

      This is primarily used in advanced scenarios where a characteristic is being used as a placeholder for values that will be defined later, e.g., by an external system.

      Since:
      Catalog Services 2.3.0, Release Train 2.3.0
    • 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
    • setAttributes

      public void setAttributes(Map<String,Object> attributes)
      Additional custom attributes associated with extensions and complex value types, e.g., enum, variant option.
      Since:
      Catalog Service 2.2.1, Release Train 2.2.1
    • 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
    • toString

      public String toString()
      Overrides:
      toString in class Object