Class 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 of FeatureContainer
    • 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:
        true if 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:
        iterator in interface java.lang.Iterable<Feature>
      • hasUntypedFeatures

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