Class AnnotationValue.ForEnumerationDescription.UnknownRuntimeEnumeration

  • All Implemented Interfaces:
    AnnotationValue.Loaded<java.lang.Enum<?>>
    Enclosing class:
    AnnotationValue.ForEnumerationDescription<U extends java.lang.Enum<U>>

    public static class AnnotationValue.ForEnumerationDescription.UnknownRuntimeEnumeration
    extends AnnotationValue.Loaded.AbstractBase<java.lang.Enum<?>>

    Represents an annotation's enumeration value for a constant that does not exist for the runtime enumeration type.

    Note: Neither of Object.hashCode(), Object.toString() and Object.equals(Object) are implemented specifically what resembles the way such exceptional states are represented in the Open JDK's annotation implementations.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<? extends java.lang.Enum<?>> enumType
      The loaded enumeration type.
      private java.lang.String value
      The value for which no enumeration constant exists at runtime.
    • Constructor Summary

      Constructors 
      Constructor Description
      UnknownRuntimeEnumeration​(java.lang.Class<? extends java.lang.Enum<?>> enumType, java.lang.String value)
      Creates a new representation for an unknown enumeration constant of an annotation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AnnotationValue.Loaded.State getState()
      Returns the state of the represented loaded annotation value.
      boolean represents​(java.lang.Object value)
      Verifies if this loaded value represents the supplied loaded value.
      java.lang.Enum<?> resolve()
      Resolves the value to the actual value of an annotation.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • enumType

        private final java.lang.Class<? extends java.lang.Enum<?>> enumType
        The loaded enumeration type.
      • value

        private final java.lang.String value
        The value for which no enumeration constant exists at runtime.
    • Constructor Detail

      • UnknownRuntimeEnumeration

        public UnknownRuntimeEnumeration​(java.lang.Class<? extends java.lang.Enum<?>> enumType,
                                         java.lang.String value)
        Creates a new representation for an unknown enumeration constant of an annotation.
        Parameters:
        enumType - The loaded enumeration type.
        value - The value for which no enumeration constant exists at runtime.
    • Method Detail

      • getState

        public AnnotationValue.Loaded.State getState()
        Returns the state of the represented loaded annotation value.
        Returns:
        The state represented by this instance.
      • resolve

        public java.lang.Enum<?> resolve()
        Resolves the value to the actual value of an annotation. Calling this method might throw a runtime exception if this value is either not defined or not resolved.
        Returns:
        The actual annotation value represented by this instance.
      • represents

        public boolean represents​(java.lang.Object value)
        Verifies if this loaded value represents the supplied loaded value.
        Parameters:
        value - A loaded annotation value.
        Returns:
        true if the supplied annotation value is represented by this annotation value.