Class UniversalConstruct<T extends AnnotatedConstruct>
java.lang.Object
org.microbean.construct.UniversalConstruct<T>
- Type Parameters:
T- a type ofAnnotatedConstruct, which may be only eitherElementorTypeMirror
- All Implemented Interfaces:
Constable,AnnotatedConstruct
- Direct Known Subclasses:
UniversalElement,UniversalType
public abstract sealed class UniversalConstruct<T extends AnnotatedConstruct>
extends Object
implements AnnotatedConstruct, Constable
permits UniversalElement, UniversalType
An abstract implementation of
AnnotatedConstruct from which only UniversalElement and UniversalType descend.- Author:
- Laird Nelson
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUniversalConstruct(T delegate, Domain domain) Creates a newAnnotatedConstruct. -
Method Summary
Modifier and TypeMethodDescriptionfinal Tdelegate()Returns the delegate to which operations are delegated.final Optional<? extends ConstantDesc> final Domaindomain()Returns theDomainsupplied at construction time.final <A extends Annotation>
AgetAnnotation(Class<A> annotationType) final List<? extends AnnotationRecord> final <A extends Annotation>
A[]getAnnotationsByType(Class<A> annotationType) final StringtoString()static final <T extends AnnotatedConstruct>
Tunwrap(T t) Unwraps the suppliedAnnotatedConstructimplementation such that the returned value is not an instance ofUniversalConstruct.
-
Constructor Details
-
UniversalConstruct
Creates a newAnnotatedConstruct.- Parameters:
delegate- a delegate to which operations are delegated; must not benulldomain- ; aDomainfrom which the supplieddelegateis presumed to have originated; must not benull- Throws:
NullPointerException- if either argument isnull
-
-
Method Details
-
delegate
-
describeConstable
- Specified by:
describeConstablein interfaceConstable
-
domain
-
getAnnotationMirrors
- Specified by:
getAnnotationMirrorsin interfaceAnnotatedConstruct
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedConstruct
-
getAnnotationsByType
- Specified by:
getAnnotationsByTypein interfaceAnnotatedConstruct
-
toString
-
unwrap
Unwraps the suppliedAnnotatedConstructimplementation such that the returned value is not an instance ofUniversalConstruct.- Type Parameters:
T- anAnnotatedConstructsubtype (possiblyUniversalElementorUniversalType)- Parameters:
t- anAnnotatedConstruct; may benull- Returns:
- an object of the appropriate type that is guaranteed not to be an instance of
UniversalConstruct - See Also:
-