Class FeatureList

java.lang.Object
de.hybris.platform.classification.features.FeatureList
All Implemented Interfaces:
Iterable<Feature>

public class FeatureList extends Object implements Iterable<Feature>
A list of features for a product. This class is the service representation of FeatureContainer
  • Constructor Details

    • FeatureList

      public FeatureList(List<Feature> features)
      Initializes this object with a list of features.
      Parameters:
      features - the list of features
      Throws:
      IllegalArgumentException - if the list is null
    • FeatureList

      public FeatureList(Feature... features)
      Initializes this object with variable array of features.
      Parameters:
      features - the list of features
      Throws:
      IllegalArgumentException - if the list is null
  • Method Details

    • getFeatures

      public List<Feature> getFeatures()
      Returns the list of features. The list is unmodifiable.
      Returns:
      the list of features
    • isEmpty

      public boolean isEmpty()
      Returns:
      true if this feature list contains no features at all.
    • getFeatureByName

      public Feature getFeatureByName(String name)
      Returns the feature with the given name of null if there's no such feature.
      Parameters:
      name - the of the feature to look up
      Returns:
      the feature with the given name of null if there's no such feature
      Throws:
      IllegalArgumentException - if the name is null
    • getFeatureByAssignment

      public Feature getFeatureByAssignment(ClassAttributeAssignmentModel assignment)
      Gets the feature by assignment.
      Parameters:
      assignment - the assignment
      Returns:
      the feature by assignment
    • getFeatureByCode

      public Feature getFeatureByCode(String code)
      Returns the (typed) feature assigned to the attribute with the given code, or null if there's no such feature.
      Parameters:
      code - the code of the attribute the feature is assigned to
      Returns:
      the (typed) feature assigned to the attribute with the given code, or null if there's no such feature
      Throws:
      IllegalArgumentException - if the code is null
    • iterator

      public Iterator<Feature> iterator()
      Specified by:
      iterator in interface Iterable<Feature>
    • getClassificationClasses

      public Set<ClassificationClassModel> getClassificationClasses()
      Returns:
      a HashSet with ClassificationClassModels.
    • getClassAttributeAssignments

      public Set<ClassAttributeAssignmentModel> getClassAttributeAssignments()
      Returns:
      a HashSet with ClassAttributeAssignmentModels.
    • hasUntypedFeatures

      public boolean hasUntypedFeatures()
      Returns:
      true if this feature list contains any untyped feature.