Class FeatureList
- java.lang.Object
-
- de.hybris.platform.classification.features.FeatureList
-
- All Implemented Interfaces:
java.lang.Iterable<Feature>
public class FeatureList extends java.lang.Object implements java.lang.Iterable<Feature>
A list of features for a product. This class is the service representation ofFeatureContainer
-
-
Constructor Summary
Constructors Constructor Description FeatureList(Feature... features)Initializes this object with variable array of features.FeatureList(java.util.List<Feature> features)Initializes this object with a list of features.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<ClassAttributeAssignmentModel>getClassAttributeAssignments()java.util.Set<ClassificationClassModel>getClassificationClasses()FeaturegetFeatureByAssignment(ClassAttributeAssignmentModel assignment)Gets the feature by assignment.FeaturegetFeatureByCode(java.lang.String code)Returns the (typed) feature assigned to the attribute with the given code, or null if there's no such feature.FeaturegetFeatureByName(java.lang.String name)Returns the feature with the given name of null if there's no such feature.java.util.List<Feature>getFeatures()Returns the list of features.booleanhasUntypedFeatures()booleanisEmpty()java.util.Iterator<Feature>iterator()
-
-
-
Constructor Detail
-
FeatureList
public FeatureList(java.util.List<Feature> features)
Initializes this object with a list of features.- Parameters:
features- the list of features- Throws:
java.lang.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:
java.lang.IllegalArgumentException- if the list is null
-
-
Method Detail
-
getFeatures
public java.util.List<Feature> getFeatures()
Returns the list of features. The list is unmodifiable.- Returns:
- the list of features
-
isEmpty
public boolean isEmpty()
- Returns:
trueif this feature list contains no features at all.
-
getFeatureByName
public Feature getFeatureByName(java.lang.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:
java.lang.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(java.lang.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:
java.lang.IllegalArgumentException- if the code is null
-
iterator
public java.util.Iterator<Feature> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<Feature>
-
getClassificationClasses
public java.util.Set<ClassificationClassModel> getClassificationClasses()
- Returns:
- a
HashSetwithClassificationClassModels.
-
getClassAttributeAssignments
public java.util.Set<ClassAttributeAssignmentModel> getClassAttributeAssignments()
- Returns:
- a
HashSetwithClassAttributeAssignmentModels.
-
hasUntypedFeatures
public boolean hasUntypedFeatures()
- Returns:
trueif this feature list contains any untyped feature.
-
-