java.lang.Object
de.hybris.platform.classification.features.Feature
Direct Known Subclasses:
LocalizedFeature, UnlocalizedFeature

public abstract class Feature extends Object
A product feature with its FeatureValues and along with its ClassAttributeAssignmentModel if any. This class is the service representation of Feature.
  • Field Details

  • Constructor Details

  • Method Details

    • getCode

      public String getCode()
      Gets the code of the feature computed from assignment for typed feature or direct code for untyped feature.
      Returns:
      the code
      See Also:
    • getValues

      public abstract List<FeatureValue> getValues()
      Returns the list of feature values. The list is unmodifiable.
      Returns:
      the list of feature values
    • getValue

      public abstract FeatureValue getValue()
      Convenience method to return a single value. If the value list is empty this method will return null. If the list's size is greater that one it will return the first element.
      Returns:
      method to return a single value
    • addValue

      public abstract void addValue(FeatureValue fvalue)
      Add to this feature a FeatureValue
      Parameters:
      fvalue - the feature value
    • addValue

      public abstract void addValue(int index, FeatureValue fvalue)
      Inserts the FeatureValueat the specified index position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
      Parameters:
      index - the index value
      fvalue - the feature value
    • removeValue

      public abstract boolean removeValue(FeatureValue fvalue)
      Removes the first occurrence of the given FeatureValue from the feature, if it is present (optional operation). If this UnlocalizedFeature does not contain this FeatureValue, it is unchanged. More formally, removes the element with the lowest index i such that (o==null ? get(i)==null : o.equals(get(i))) (if such an element exists). Returns true if the feature contained the specified feature value.
      Parameters:
      fvalue - the FeatureValue to be removed
      Returns:
      true if the feature value was removed successfully
    • removeAllValues

      public abstract void removeAllValues()
      Remove all containing FeatureValues from the current feature.
    • setValues

      public abstract void setValues(List<FeatureValue> fvalues)
      Clears always all FeatureValue of this Feature and add the given List with FeatureValues to this Feature. If the parameter is null the internal FeatureValue List will only be cleared (same behaviour as removeAllValues()
      Parameters:
      fvalues - the list with feature values or null
    • toString

      public String toString()
      Returns a human readable description.
      Overrides:
      toString in class Object
    • getClassAttributeAssignment

      public ClassAttributeAssignmentModel getClassAttributeAssignment()
      Returns the classification attribute assignment or null if untyped feature.
      Returns:
      the classification attribute assignment or null if untyped feature
    • getName

      public String getName()
      Returns name of the feature. If this feature has no ClassAttributeAssignmentModel the code is returned instead.
      Returns:
      the localized name of the feature