public final class AnnotationMap extends Object implements Annotations
Modifier and Type | Field and Description |
---|---|
protected HashMap<Class<?>,Annotation> |
_annotations |
Constructor and Description |
---|
AnnotationMap() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_add(Annotation ann) |
boolean |
add(Annotation ann)
Method called to add specified annotation in the Map.
|
boolean |
addIfNotPresent(Annotation ann)
Method called to add specified annotation in the Map, but
only if it didn't yet exist.
|
Iterable<Annotation> |
annotations() |
<A extends Annotation> |
get(Class<A> cls)
Main access method used to find value for given annotation.
|
boolean |
has(Class<?> cls) |
boolean |
hasOneOf(Class<? extends Annotation>[] annoClasses)
Helper method that can be used for a "bulk" check to see if at least
one of given annotation types is included within this map.
|
static AnnotationMap |
merge(AnnotationMap primary,
AnnotationMap secondary) |
static AnnotationMap |
of(Class<?> type,
Annotation value) |
int |
size()
Returns number of annotation entries in this collection.
|
String |
toString() |
protected HashMap<Class<?>,Annotation> _annotations
public static AnnotationMap of(Class<?> type, Annotation value)
public <A extends Annotation> A get(Class<A> cls)
Annotations
get
in interface Annotations
public boolean has(Class<?> cls)
has
in interface Annotations
public boolean hasOneOf(Class<? extends Annotation>[] annoClasses)
hasOneOf
in interface Annotations
public Iterable<Annotation> annotations()
public static AnnotationMap merge(AnnotationMap primary, AnnotationMap secondary)
public int size()
Annotations
size
in interface Annotations
public boolean addIfNotPresent(Annotation ann)
public boolean add(Annotation ann)
protected final boolean _add(Annotation ann)
Copyright © 2008–2021 FasterXML. All rights reserved.