public Class<? extends Annotation> getAnnotationType() { return this.annotation.annotationType(); }
@Override public String toString() { return this.annotation.toString(); } }
protected final boolean _add(Annotation ann) { if (_annotations == null) { _annotations = new HashMap<Class<?>,Annotation>(); } Annotation previous = _annotations.put(ann.annotationType(), ann); return (previous == null) || !previous.equals(ann); } }
@Override public boolean equals(Object other) { if (this == other) { return true; } AnnotationConverterKey otherKey = (AnnotationConverterKey) other; return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation)); }
/** * {@inheritDoc} */ public boolean represents(Object value) { return annotation.equals(value); }
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () { return annotation.annotationType(); } }
protected final boolean _add(Annotation ann) { if (_annotations == null) { _annotations = new HashMap<Class<?>,Annotation>(); } Annotation previous = _annotations.put(ann.annotationType(), ann); return (previous == null) || !previous.equals(ann); } }
@Override public boolean equals(Object other) { if (this == other) { return true; } AnnotationConverterKey otherKey = (AnnotationConverterKey) other; return (this.fieldType == otherKey.fieldType && this.annotation.equals(otherKey.annotation)); }
@Override public String toString() { return annotation.toString(); } }
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () { return annotation.annotationType(); } }
private boolean annotationEquals(Annotation ann, Annotation otherAnn) { // Annotation.equals is reflective and pretty slow, so let's check identity and proxy type first. return (ann == otherAnn || (ann.getClass() == otherAnn.getClass() && ann.equals(otherAnn))); }
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () { return annotation.annotationType(); } }
@Override public boolean equals(Object other) { if (this == other) { return true; } else if (!(other instanceof AnnotationValue.Loaded<?>)) { return false; } AnnotationValue.Loaded<?> annotationValue = (AnnotationValue.Loaded<?>) other; return annotationValue.getState().isResolved() && annotation.equals(annotationValue.resolve()); }
public Class<? extends java.lang.annotation.Annotation> getAnnotationType () { return annotation.annotationType(); } }
/** * Creates a new annotation description for a loaded annotation. * * @param annotation The annotation to represent. */ @SuppressWarnings("unchecked") protected ForLoadedAnnotation(S annotation) { this(annotation, (Class<S>) annotation.annotationType()); }
@Override public boolean isPresent(Annotation ann) { return ann.annotationType() == _type; }
@Override public boolean isPresent(Annotation ann) { return ann.annotationType() == _type; }
@Override @SuppressWarnings("unchecked") @Nullable public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { for (Annotation ann : annotations) { if (ann.annotationType() == annotationClass) { return (T) ann; } } return null; } @Override
/** * Construct a new {@code DefaultAnnotationAttributeExtractor}. * @param annotation the annotation to synthesize; never {@code null} * @param annotatedElement the element that is annotated with the supplied * annotation; may be {@code null} if unknown */ DefaultAnnotationAttributeExtractor(Annotation annotation, @Nullable Object annotatedElement) { super(annotation.annotationType(), annotatedElement, annotation); }
@Nullable public Class<? extends Annotation> getComposedAnnotationType() { return (this.composedAnnotation != null ? this.composedAnnotation.annotationType() : null); }