Package org.apache.bval.cdi
Class EmptyAnnotationLiteral<T extends Annotation>
- java.lang.Object
-
- jakarta.enterprise.util.AnnotationLiteral<T>
-
- org.apache.bval.cdi.EmptyAnnotationLiteral<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
Serializable
,Annotation
- Direct Known Subclasses:
AnnotationProxyBuilder.ValidAnnotation
,AnyLiteral
,BValAnnotatedType.BValBindingLiteral
,DefaultLiteral
public abstract class EmptyAnnotationLiteral<T extends Annotation> extends jakarta.enterprise.util.AnnotationLiteral<T>
Base class for AnnotationLiterals which have no members. Taken from Apache OpenWebBeans.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EmptyAnnotationLiteral()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<? extends Annotation>
annotationType()
Implemented for compatibility reasons with other cdi-api jar's.boolean
equals(Object other)
Just checks whether the 2 classes have the same annotationType.int
hashCode()
Implemented for performance reasons.
-
-
-
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 interfaceAnnotation
- Overrides:
annotationType
in classjakarta.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 genericAnnotationLiteral.hashCode()
always does search for methods via reflection and only then returns 0. Not very well performing ...- Specified by:
hashCode
in interfaceAnnotation
- Overrides:
hashCode
in classjakarta.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 interfaceAnnotation
- Overrides:
equals
in classjakarta.enterprise.util.AnnotationLiteral<T extends Annotation>
-
-