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.DispatcherA dispatcher for resolving ajava.lang.reflect.RecordComponent.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRecordComponentDescription.ForLoadedRecordComponent.Dispatcher.CreationActionA creation action for creating a dispatcher.static classRecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVmA dispatcher for a Java 14-capable JVM.static classRecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForLegacyVmA 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.MethodgetAccessor(java.lang.Object recordComponent)Resolves a record component's accessor method.java.lang.reflect.AnnotatedElementgetAnnotatedType(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.StringgetGenericSignature(java.lang.Object recordComponent)Returns the record component type's generic signature.java.lang.reflect.TypegetGenericType(java.lang.Object recordComponent)Resolves a record component's generic type.java.lang.StringgetName(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.booleanisInstance(java.lang.Object instance)Checks if the supplied instance is a record component.booleanisRecord(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:
trueif 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:
trueif 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
nullif 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.
-
-