Class EmptyAnnotationLiteral<T extends Annotation>

    • Nested Class Summary

      • Nested classes/interfaces inherited from class javax.enterprise.util.AnnotationLiteral

        javax.enterprise.util.AnnotationLiteral.PrivilegedActionForAccessibleObject
    • Constructor Detail

      • EmptyAnnotationLiteral

        protected EmptyAnnotationLiteral()
    • Method Detail

      • annotationType

        public Class<? extends Annotation> annotationType()
        Implemented for compatibility reasons with other cdi-api jar's. See OWB-802.
        Specified by:
        annotationType in interface Annotation
        Overrides:
        annotationType in class javax.enterprise.util.AnnotationLiteral<T extends Annotation>
      • hashCode

        public int hashCode()
        Implemented for performance reasons. This is needed because an Annotation always returns 0 as hashCode if there is no method in it. Contrary to this the generic AnnotationLiteral.hashCode() always does search for methods via reflection and only then returns 0. Not very well performing ...
        Specified by:
        hashCode in interface Annotation
        Overrides:
        hashCode in class javax.enterprise.util.AnnotationLiteral<T extends Annotation>
        Returns:
        always 0
      • equals

        public boolean equals​(Object other)
        Just checks whether the 2 classes have the same annotationType. We do not need to dynamically evaluate the member values via reflection as there are no members in this annotation at all.
        Specified by:
        equals in interface Annotation
        Overrides:
        equals in class javax.enterprise.util.AnnotationLiteral<T extends Annotation>