Class UniversalAnnotationValue
java.lang.Object
org.microbean.construct.element.UniversalAnnotationValue
- All Implemented Interfaces:
AnnotationValue
An
AnnotationValue implementation.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUniversalAnnotationValue(AnnotationValue delegate, Domain domain) Creates a newUniversalAnnotationValue. -
Method Summary
Modifier and TypeMethodDescriptionfinal <R,P> R accept(AnnotationValueVisitor<R, P> v, P p) final AnnotationValuedelegate()Returns the delegate to which operations are delegated.final Domaindomain()Returns theDomainsupplied at construction time.final booleanfinal ObjectgetValue()final inthashCode()static final List<? extends UniversalAnnotationValue> of(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null, immutableListofUniversalAnnotationValues whose elements wrap the suppliedList's elements.static final UniversalAnnotationValueof(AnnotationValue av, Domain domain) Returns a non-nullUniversalAnnotationValuethat is either the suppliedAnnotationValue(if it itself isnullor is anUniversalAnnotationValue) or one that wraps it.final StringtoString()static final AnnotationValueUnwraps the suppliedAnnotationValueimplementation such that the returned value is not an instance ofUniversalAnnotationValue.
-
Constructor Details
-
UniversalAnnotationValue
Creates a newUniversalAnnotationValue.- Parameters:
delegate- anAnnotationValueto which operations will be delegated; must not benulldomain- aDomain; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceAnnotationValue
-
delegate
Returns the delegate to which operations are delegated.- Returns:
- a non-
nulldelegate - See Also:
-
domain
-
equals
-
getValue
- Specified by:
getValuein interfaceAnnotationValue
-
hashCode
-
toString
-
of
Returns a non-nullUniversalAnnotationValuethat is either the suppliedAnnotationValue(if it itself isnullor is anUniversalAnnotationValue) or one that wraps it.- Parameters:
av- anAnnotationValue; may benulldomain- aDomain; must not benull- Returns:
- an
UniversalAnnotationValue, ornull(ifavisnull) - Throws:
NullPointerException- ifdomainisnull- See Also:
-
of
public static final List<? extends UniversalAnnotationValue> of(Collection<? extends AnnotationValue> avs, Domain domain) Returns a non-null, immutableListofUniversalAnnotationValues whose elements wrap the suppliedList's elements.- Parameters:
avs- aCollectionofAnnotationValues; must not benulldomain- aDomain; must not benull- Returns:
- a non-
null, immutableListofUniversalAnnotationValues - Throws:
NullPointerException- if either argument isnull
-
unwrap
Unwraps the suppliedAnnotationValueimplementation such that the returned value is not an instance ofUniversalAnnotationValue.- Parameters:
a- anAnnotationValue; may benull- Returns:
- an
AnnotationValuethat is guaranteed not to be an instance ofUniversalAnnotationValue - See Also:
-