Enum Relevance

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Relevance>

    public enum Relevance
    extends java.lang.Enum<Relevance>
    Defines the relevance of a PolicyAttribute, derived from its value set:
    • An attribute with an empty (or null) value set is considered IRRELEVANT - no value should be set
    • An attribute with value set containing null is considered OPTIONAL - a value can be set but is not required
    • An attribute with a non-empty value set not containing null is considered MANDATORY - a value must be set
    An attribute that is not IRRELEVANT (OPTIONAL or MANDATORY) is considered relevant - its value should for example be checked against the value set.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      IRRELEVANT
      An attribute with an empty (or null) value set - no value should be set.
      MANDATORY
      An attribute with a non-empty value set not containing null - a value must be set.
      OPTIONAL
      An attribute with value set containing null - a value can be set but is not required.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isIrrelevant​(IModelObject modelObject, java.lang.String property)
      Returns whether the attribute with the given property name is considered IRRELEVANT for the given model object.
      static boolean isIrrelevant​(IModelObject modelObject, PolicyAttribute policyAttribute)
      Returns whether the given attribute is considered IRRELEVANT for the given model object.
      static boolean isMandatory​(IModelObject modelObject, java.lang.String property)
      Returns whether the attribute with the given property name is considered MANDATORY for the given model object.
      static boolean isMandatory​(IModelObject modelObject, PolicyAttribute policyAttribute)
      Returns whether the given attribute is considered MANDATORY for the given model object.
      static boolean isOptional​(IModelObject modelObject, java.lang.String property)
      Returns whether the attribute with the given property name is considered OPTIONAL for the given model object.
      static boolean isOptional​(IModelObject modelObject, PolicyAttribute policyAttribute)
      Returns whether the given attribute is considered OPTIONAL for the given model object.
      static boolean isRelevant​(IModelObject modelObject, java.lang.String property)
      Returns whether the attribute with the given property name is considered relevant for the given model object.
      static boolean isRelevant​(IModelObject modelObject, PolicyAttribute policyAttribute)
      Returns whether the given attribute is considered relevant for the given model object.
      static Relevance of​(IModelObject modelObject, java.lang.String property)
      Returns the Relevance of the PolicyAttribute identified by the given property name for the given model object.
      static Relevance of​(IModelObject modelObject, PolicyAttribute policyAttribute)
      Returns the Relevance of the given PolicyAttribute for the given model object.
      static Relevance valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Relevance[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • IRRELEVANT

        public static final Relevance IRRELEVANT
        An attribute with an empty (or null) value set - no value should be set.
      • OPTIONAL

        public static final Relevance OPTIONAL
        An attribute with value set containing null - a value can be set but is not required.
      • MANDATORY

        public static final Relevance MANDATORY
        An attribute with a non-empty value set not containing null - a value must be set.
    • Method Detail

      • values

        public static Relevance[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Relevance c : Relevance.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Relevance valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isIrrelevant

        public static boolean isIrrelevant​(IModelObject modelObject,
                                           java.lang.String property)
        Returns whether the attribute with the given property name is considered IRRELEVANT for the given model object.
      • isIrrelevant

        public static boolean isIrrelevant​(IModelObject modelObject,
                                           PolicyAttribute policyAttribute)
        Returns whether the given attribute is considered IRRELEVANT for the given model object.
      • isMandatory

        public static boolean isMandatory​(IModelObject modelObject,
                                          java.lang.String property)
        Returns whether the attribute with the given property name is considered MANDATORY for the given model object.
      • isMandatory

        public static boolean isMandatory​(IModelObject modelObject,
                                          PolicyAttribute policyAttribute)
        Returns whether the given attribute is considered MANDATORY for the given model object.
      • isOptional

        public static boolean isOptional​(IModelObject modelObject,
                                         java.lang.String property)
        Returns whether the attribute with the given property name is considered OPTIONAL for the given model object.
      • isOptional

        public static boolean isOptional​(IModelObject modelObject,
                                         PolicyAttribute policyAttribute)
        Returns whether the given attribute is considered OPTIONAL for the given model object.
      • isRelevant

        public static boolean isRelevant​(IModelObject modelObject,
                                         java.lang.String property)
        Returns whether the attribute with the given property name is considered relevant for the given model object.
      • isRelevant

        public static boolean isRelevant​(IModelObject modelObject,
                                         PolicyAttribute policyAttribute)
        Returns whether the given attribute is considered relevant for the given model object.