Package net.bytebuddy.description.type
Interface RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
-
- All Known Implementing Classes:
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm
,RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForLegacyVm
- Enclosing class:
- RecordComponentDescription.ForLoadedRecordComponent
protected static interface RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
A dispatcher for resolving ajava.lang.reflect.RecordComponent
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.CreationAction
A creation action for creating a dispatcher.static class
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm
A dispatcher for a Java 14-capable JVM.static class
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForLegacyVm
A dispatcher for a legacy VM that does not support records.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Method
getAccessor(Object recordComponent)
Resolves a record component's accessor method.AnnotatedElement
getAnnotatedType(Object recordComponent)
Resolves a record component's annotated type.Class<?>
getDeclaringType(Object recordComponent)
Resolves a record component's declaring type.String
getGenericSignature(Object recordComponent)
Returns the record component type's generic signature.Type
getGenericType(Object recordComponent)
Resolves a record component's generic type.String
getName(Object recordComponent)
Resolves a record component's name.Object[]
getRecordComponents(Class<?> type)
Resolves a type's record components.Class<?>
getType(Object recordComponent)
Resolves a record component's type.boolean
isInstance(Object instance)
Checks if the supplied instance is a record component.boolean
isRecord(Class<?> type)
Checks if the supplied type is a record.
-
-
-
Method Detail
-
isInstance
boolean isInstance(Object instance)
Checks if the supplied instance is a record component.- Parameters:
instance
- The instance to evaluate.- Returns:
true
if the supplied instance is a record component.
-
getRecordComponents
Object[] getRecordComponents(Class<?> type)
Resolves a type's record components.- Parameters:
type
- The type for which to read the record components.- Returns:
- An array of all declared record components.
-
isRecord
boolean isRecord(Class<?> type)
Checks if the supplied type is a record.- Parameters:
type
- The type to resolve.- Returns:
true
if the supplied type is a record.
-
getName
String getName(Object recordComponent)
Resolves a record component's name.- Parameters:
recordComponent
- The record component to resolve the name for.- Returns:
- The record component's name.
-
getDeclaringType
Class<?> getDeclaringType(Object recordComponent)
Resolves a record component's declaring type.- Parameters:
recordComponent
- The record component to resolve the declared type for.- Returns:
- The record component's declaring type.
-
getAccessor
Method getAccessor(Object recordComponent)
Resolves a record component's accessor method.- Parameters:
recordComponent
- The record component to resolve the accessor method for.- Returns:
- The record component's accessor method.
-
getType
Class<?> getType(Object recordComponent)
Resolves a record component's type.- Parameters:
recordComponent
- The record component to resolve the type for.- Returns:
- The record component's type.
-
getGenericType
Type getGenericType(Object recordComponent)
Resolves a record component's generic type.- Parameters:
recordComponent
- The record component to resolve the generic type for.- Returns:
- The record component's generic type.
-
getGenericSignature
String getGenericSignature(Object recordComponent)
Returns the record component type's generic signature.- Parameters:
recordComponent
- The record component to resolve the generic signature for.- Returns:
- The record component type's generic signature or
null
if no signature is defined.
-
getAnnotatedType
AnnotatedElement getAnnotatedType(Object recordComponent)
Resolves a record component's annotated type.- Parameters:
recordComponent
- The record component to resolve the annotated type for.- Returns:
- The record component's annotated type.
-
-