Enum Optionality

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

    public enum Optionality
    extends java.lang.Enum<Optionality>
    Four states that describe whether a particular behavior or property is allowed and/or not allowed.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      FORBIDDEN
      A property is forbidden if an instance must not possess it; it is an error if the instance has the property.
      IGNORED
      A property is ignored if an instance may or may not possess it; if it possesses the property, the effect is as if it does not.
      MANDATORY
      A property is mandatory if an instance must possess it; it is an error if it does not.
      OPTIONAL
      A property is optional if an instance may or may not possess it; neither state is an error.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Optionality()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static Optionality valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Optionality[] 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

      • MANDATORY

        public static final Optionality MANDATORY
        A property is mandatory if an instance must possess it; it is an error if it does not.
      • OPTIONAL

        public static final Optionality OPTIONAL
        A property is optional if an instance may or may not possess it; neither state is an error.
      • IGNORED

        public static final Optionality IGNORED
        A property is ignored if an instance may or may not possess it; if it possesses the property, the effect is as if it does not.
      • FORBIDDEN

        public static final Optionality FORBIDDEN
        A property is forbidden if an instance must not possess it; it is an error if the instance has the property.
    • Constructor Detail

      • Optionality

        private Optionality()
    • Method Detail

      • values

        public static Optionality[] 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 (Optionality c : Optionality.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Optionality 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