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 java.lang.reflect.Method
getAccessor(java.lang.Object recordComponent)
Resolves a record component's accessor method.java.lang.reflect.AnnotatedElement
getAnnotatedType(java.lang.Object recordComponent)
Resolves a record component's annotated type.java.lang.Class<?>
getDeclaringType(java.lang.Object recordComponent)
Resolves a record component's declaring type.java.lang.String
getGenericSignature(java.lang.Object recordComponent)
Returns the record component type's generic signature.java.lang.reflect.Type
getGenericType(java.lang.Object recordComponent)
Resolves a record component's generic type.java.lang.String
getName(java.lang.Object recordComponent)
Resolves a record component's name.java.lang.Object[]
getRecordComponents(java.lang.Class<?> type)
Resolves a type's record components.java.lang.Class<?>
getType(java.lang.Object recordComponent)
Resolves a record component's type.boolean
isInstance(java.lang.Object instance)
Checks if the supplied instance is a record component.boolean
isRecord(java.lang.Class<?> type)
Checks if the supplied type is a record.
-
-
-
Method Detail
-
isInstance
boolean isInstance(java.lang.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
java.lang.Object[] getRecordComponents(java.lang.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(java.lang.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
java.lang.String getName(java.lang.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
java.lang.Class<?> getDeclaringType(java.lang.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
java.lang.reflect.Method getAccessor(java.lang.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
java.lang.Class<?> getType(java.lang.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
java.lang.reflect.Type getGenericType(java.lang.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
java.lang.String getGenericSignature(java.lang.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
java.lang.reflect.AnnotatedElement getAnnotatedType(java.lang.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.
-
-