public final class AnnotationMap extends java.lang.Object implements Annotations
Modifier and Type | Field and Description |
---|---|
protected java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> |
_annotations |
Modifier | Constructor and Description |
---|---|
|
AnnotationMap() |
private |
AnnotationMap(java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> a) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
_add(java.lang.annotation.Annotation ann) |
boolean |
add(java.lang.annotation.Annotation ann)
Method called to add specified annotation in the Map.
|
boolean |
addIfNotPresent(java.lang.annotation.Annotation ann)
Method called to add specified annotation in the Map, but
only if it didn't yet exist.
|
java.lang.Iterable<java.lang.annotation.Annotation> |
annotations() |
<A extends java.lang.annotation.Annotation> |
get(java.lang.Class<A> cls)
Main access method used to find value for given annotation.
|
boolean |
has(java.lang.Class<?> cls) |
boolean |
hasOneOf(java.lang.Class<? extends java.lang.annotation.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) |
int |
size()
Returns number of annotation entries in this collection.
|
java.lang.String |
toString() |
protected java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> _annotations
public AnnotationMap()
private AnnotationMap(java.util.HashMap<java.lang.Class<?>,java.lang.annotation.Annotation> a)
public <A extends java.lang.annotation.Annotation> A get(java.lang.Class<A> cls)
Annotations
get
in interface Annotations
public boolean has(java.lang.Class<?> cls)
public boolean hasOneOf(java.lang.Class<? extends java.lang.annotation.Annotation>[] annoClasses)
public java.lang.Iterable<java.lang.annotation.Annotation> annotations()
public static AnnotationMap merge(AnnotationMap primary, AnnotationMap secondary)
public int size()
Annotations
size
in interface Annotations
public boolean addIfNotPresent(java.lang.annotation.Annotation ann)
public boolean add(java.lang.annotation.Annotation ann)
public java.lang.String toString()
toString
in class java.lang.Object
protected final boolean _add(java.lang.annotation.Annotation ann)