Package space.arim.dazzleconf.reflect
Class ReifiedType.Annotated
java.lang.Object
space.arim.dazzleconf.reflect.ReifiedType
space.arim.dazzleconf.reflect.ReifiedType.Annotated
- All Implemented Interfaces:
AnnotatedElement
- Enclosing class:
ReifiedType
Annotation capable extension to a reified type.
-
Nested Class Summary
Nested classes/interfaces inherited from class space.arim.dazzleconf.reflect.ReifiedType
ReifiedType.Annotated -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ReifiedType.Annotated[]A reusable empty array for this type -
Constructor Summary
ConstructorsConstructorDescriptionAnnotated(@NonNull Class<?> rawType, @NonNull ReifiedType.Annotated @NonNull [] arguments, @NonNull AnnotatedElement annotations) Creates from nonnull input arguments -
Method Summary
Modifier and TypeMethodDescription@NonNull ReifiedType.AnnotatedargumentAt(int index) Gets the argument at a certain index@NonNull ReifiedType.Annotated @NonNull []Gets all the arguments<T extends Annotation>
TgetAnnotation(@NonNull Class<T> annotationClass) Annotation @NonNull []<T extends Annotation>
T @NonNull []getAnnotationsByType(@NonNull Class<T> annotationClass) <T extends Annotation>
TgetDeclaredAnnotation(@NonNull Class<T> annotationClass) Annotation @NonNull []<T extends Annotation>
T @NonNull []getDeclaredAnnotationsByType(@NonNull Class<T> annotationClass) booleanisAnnotationPresent(@NonNull Class<? extends Annotation> annotationClass) static AnnotatedElementGets a dummy annotated element, containing no annotations.static @NonNull ReifiedType.Annotatedunannotated(@NonNull Class<?> rawType) Creates an unparameterized, unannotated reified type for the following raw class.Methods inherited from class space.arim.dazzleconf.reflect.ReifiedType
argumentCount, equals, hashCode, rawType, toString
-
Field Details
-
EMPTY_ARRAY
A reusable empty array for this type
-
-
Constructor Details
-
Annotated
public Annotated(@NonNull Class<?> rawType, @NonNull ReifiedType.Annotated @NonNull [] arguments, @NonNull AnnotatedElement annotations) Creates from nonnull input argumentsThe provided
AnnotatedElementmust be immutable; it should return consistent results for consistent calls.- Parameters:
rawType- the raw typearguments- , which are copied to ensure immutabilityannotations- the annotations source, which is trusted as immutable
-
-
Method Details
-
unannotated
Creates an unparameterized, unannotated reified type for the following raw class.- Parameters:
rawType- the raw type- Returns:
- a
ReifiedType.Annotatedwith no annotations and no generic arguments (if relevant) for the provided raw type
-
unannotated
Gets a dummy annotated element, containing no annotations. This method is provided as a convenience.- Returns:
- an unannotated
AnnotatedElementobject
-
argumentAt
Gets the argument at a certain index- Overrides:
argumentAtin classReifiedType- Parameters:
index- the index- Returns:
- the argument at it
- Throws:
IndexOutOfBoundsException- if the index is out of range
-
arguments
Gets all the arguments- Overrides:
argumentsin classReifiedType- Returns:
- a copy of the arguments
-
isAnnotationPresent
- Specified by:
isAnnotationPresentin interfaceAnnotatedElement
-
getAnnotation
- Specified by:
getAnnotationin interfaceAnnotatedElement
-
getAnnotations
- Specified by:
getAnnotationsin interfaceAnnotatedElement
-
getAnnotationsByType
- Specified by:
getAnnotationsByTypein interfaceAnnotatedElement
-
getDeclaredAnnotation
- Specified by:
getDeclaredAnnotationin interfaceAnnotatedElement
-
getDeclaredAnnotationsByType
public <T extends Annotation> T @NonNull [] getDeclaredAnnotationsByType(@NonNull Class<T> annotationClass) - Specified by:
getDeclaredAnnotationsByTypein interfaceAnnotatedElement
-
getDeclaredAnnotations
- Specified by:
getDeclaredAnnotationsin interfaceAnnotatedElement
-