Class UniversalAnnotation
java.lang.Object
org.microbean.construct.element.UniversalAnnotation
- All Implemented Interfaces:
AnnotationMirror
An
AnnotationMirror implementation.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUniversalAnnotation(AnnotationMirror delegate, Domain domain) Creates a newUniversalAnnotation. -
Method Summary
Modifier and TypeMethodDescriptionfinal AnnotationMirrordelegate()Returns the delegate to which operations are delegated.final Domaindomain()Returns theDomainsupplied at construction time.final booleanfinal UniversalTypefinal Map<? extends UniversalElement, ? extends UniversalAnnotationValue> final inthashCode()static final List<? extends UniversalAnnotation> of(Collection<? extends AnnotationMirror> as, Domain domain) Returns a non-null, immutableListofUniversalAnnotations whose elements wrap the suppliedList's elements.static final UniversalAnnotationof(AnnotationMirror a, Domain d) Returns a non-nullUniversalAnnotationthat is either the suppliedAnnotationMirror(if it itself is anUniversalAnnotation) or one that wraps it.static final AnnotationMirrorUnwraps the suppliedAnnotationMirrorimplementation such that the returned value is not an instance ofUniversalAnnotation.
-
Constructor Details
-
UniversalAnnotation
Creates a newUniversalAnnotation.- Parameters:
delegate- anAnnotationMirrorto which operations will be delegated; must not benulldomain- aDomain; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
delegate
Returns the delegate to which operations are delegated.- Returns:
- a non-
nulldelegate - See Also:
-
domain
-
equals
-
getAnnotationType
- Specified by:
getAnnotationTypein interfaceAnnotationMirror
-
getElementValues
- Specified by:
getElementValuesin interfaceAnnotationMirror
-
hashCode
-
of
Returns a non-nullUniversalAnnotationthat is either the suppliedAnnotationMirror(if it itself is anUniversalAnnotation) or one that wraps it.- Parameters:
a- anAnnotationMirror; must not benulld- aDomain; must not benull- Returns:
- a non-
nullUniversalAnnotation - Throws:
NullPointerException- if either argument isnull- See Also:
-
of
public static final List<? extends UniversalAnnotation> of(Collection<? extends AnnotationMirror> as, Domain domain) Returns a non-null, immutableListofUniversalAnnotations whose elements wrap the suppliedList's elements.- Parameters:
as- aCollectionofAnnotationMirrors; must not benulldomain- aDomain; must not benull- Returns:
- a non-
null, immutableListofUniversalAnnotations - Throws:
NullPointerException- if either argument isnull
-
unwrap
Unwraps the suppliedAnnotationMirrorimplementation such that the returned value is not an instance ofUniversalAnnotation.- Parameters:
a- anAnnotationMirror; may benull- Returns:
- an
AnnotationMirrorthat is guaranteed not to be an instance ofUniversalAnnotation - See Also:
-