Class AnnotationValue.ForAnnotationDescription.IncompatibleRuntimeType

  • All Implemented Interfaces:
    AnnotationValue.Loaded<java.lang.annotation.Annotation>
    Enclosing class:
    AnnotationValue.ForAnnotationDescription<U extends java.lang.annotation.Annotation>

    public static class AnnotationValue.ForAnnotationDescription.IncompatibleRuntimeType
    extends AnnotationValue.Loaded.AbstractBase<java.lang.annotation.Annotation>

    Represents an annotation value which was attempted to ba loaded by a type that does not represent an annotation value.

    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 Detail

      • incompatibleType

        private final java.lang.Class<?> incompatibleType
        The incompatible runtime type which is not an annotation type.
    • Constructor Detail

      • IncompatibleRuntimeType

        public IncompatibleRuntimeType​(java.lang.Class<?> incompatibleType)
        Creates a new representation for an annotation with an incompatible runtime type.
        Parameters:
        incompatibleType - The incompatible runtime type which is not an annotation type.
    • 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.annotation.Annotation 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.