Class Feature


  • public final class Feature
    extends java.lang.Object
    ECP feature representation.
    Since:
    1.15
    Author:
    Mat Hansen
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Feature.STRATEGY
      Feature strategy enum.
    • Constructor Summary

      Constructors 
      Constructor Description
      Feature​(java.lang.String id, java.lang.String description)
      Default constructor (no feature inheritance).
      Feature​(java.lang.String id, java.lang.String description, Feature.STRATEGY strategy)
      Alternative constructor allowing to customize Feature.STRATEGY.
    • Constructor Detail

      • Feature

        public Feature​(java.lang.String id,
                       java.lang.String description)
        Default constructor (no feature inheritance).
        Parameters:
        id - the feature id
        description - the feature description
      • Feature

        public Feature​(java.lang.String id,
                       java.lang.String description,
                       Feature.STRATEGY strategy)
        Alternative constructor allowing to customize Feature.STRATEGY.
        Parameters:
        id - the feature id
        description - the feature description
        strategy - the feature Feature.STRATEGY
    • Method Detail

      • getId

        public java.lang.String getId()
        Returns:
        the id
      • getDescription

        public java.lang.String getDescription()
        Returns:
        the description
      • equals

        public boolean equals​(java.lang.Object obj)
        Features are like enums in that they are equal by identity.
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • inherit

        public static java.util.Set<Feature> inherit​(java.util.Collection<Feature> features,
                                                     java.util.function.Predicate<? super Feature> isSupported)
        Inherit the given features that are inheritable and are supported by the caller.
        Parameters:
        features - a collection of features to inherit
        isSupported - a test of whether the caller supports any particular feature
        Returns:
        the supported inherited features
        Since:
        1.21