Package net.bytebuddy.description.type
Class RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm
- java.lang.Object
-
- net.bytebuddy.description.type.RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm
-
- All Implemented Interfaces:
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
- Enclosing interface:
- RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
@Enhance public static class RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm extends Object implements RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
A dispatcher for a Java 14-capable JVM.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.RecordComponentDescription.ForLoadedRecordComponent.Dispatcher
RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.CreationAction, RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForJava14CapableVm, RecordComponentDescription.ForLoadedRecordComponent.Dispatcher.ForLegacyVm
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJava14CapableVm(Class<?> recordComponent, Method getRecordComponents, Method isRecord, Method getName, Method getDeclaringType, Method getAccessor, Method getType, Method getGenericType, Method getGenericSignature, Method getAnnotatedType)Creates a dispatcher for a Java 14 capable VM.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodgetAccessor(Object recordComponent)Resolves a record component's accessor method.AnnotatedElementgetAnnotatedType(Object recordComponent)Resolves a record component's annotated type.Class<?>getDeclaringType(Object recordComponent)Resolves a record component's declaring type.StringgetGenericSignature(Object recordComponent)Returns the record component type's generic signature.TypegetGenericType(Object recordComponent)Resolves a record component's generic type.StringgetName(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.booleanisInstance(Object instance)Checks if the supplied instance is a record component.booleanisRecord(Class<?> type)Checks if the supplied type is a record.
-
-
-
Constructor Detail
-
ForJava14CapableVm
protected ForJava14CapableVm(Class<?> recordComponent, Method getRecordComponents, Method isRecord, Method getName, Method getDeclaringType, Method getAccessor, Method getType, Method getGenericType, Method getGenericSignature, Method getAnnotatedType)
Creates a dispatcher for a Java 14 capable VM.- Parameters:
recordComponent- Thejava.lang.reflect.RecordComponenttype.getRecordComponents- Thejava.lang.Class#getRecordComponents()method.isRecord- Thejava.lang.Class#isRecord()method.getName- Thejava.lang.reflect.RecordComponent#getName()method.getDeclaringType- Thejava.lang.reflect.RecordComponent#getDeclaringType()method.getAccessor- Thejava.lang.reflect.RecordComponent#getAccessor()method.getType- Thejava.lang.reflect.RecordComponent#getType()method.getGenericType- Thejava.lang.reflect.RecordComponent#getGenericType()method.getGenericSignature- Thejava.lang.reflect.RecordComponent#getGenericSignature()method.getAnnotatedType- Thejava.lang.reflect.RecordComponent#getAnnotatedType()method.
-
-
Method Detail
-
isInstance
public boolean isInstance(Object instance)
Checks if the supplied instance is a record component.- Specified by:
isInstancein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
instance- The instance to evaluate.- Returns:
trueif the supplied instance is a record component.
-
getRecordComponents
public Object[] getRecordComponents(Class<?> type)
Resolves a type's record components.- Specified by:
getRecordComponentsin interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
type- The type for which to read the record components.- Returns:
- An array of all declared record components.
-
isRecord
public boolean isRecord(Class<?> type)
Checks if the supplied type is a record.- Specified by:
isRecordin interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
type- The type to resolve.- Returns:
trueif the supplied type is a record.
-
getName
public String getName(Object recordComponent)
Resolves a record component's name.- Specified by:
getNamein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the name for.- Returns:
- The record component's name.
-
getDeclaringType
public Class<?> getDeclaringType(Object recordComponent)
Resolves a record component's declaring type.- Specified by:
getDeclaringTypein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the declared type for.- Returns:
- The record component's declaring type.
-
getAccessor
public Method getAccessor(Object recordComponent)
Resolves a record component's accessor method.- Specified by:
getAccessorin interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the accessor method for.- Returns:
- The record component's accessor method.
-
getType
public Class<?> getType(Object recordComponent)
Resolves a record component's type.- Specified by:
getTypein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the type for.- Returns:
- The record component's type.
-
getGenericType
public Type getGenericType(Object recordComponent)
Resolves a record component's generic type.- Specified by:
getGenericTypein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the generic type for.- Returns:
- The record component's generic type.
-
getGenericSignature
public String getGenericSignature(Object recordComponent)
Returns the record component type's generic signature.- Specified by:
getGenericSignaturein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- 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
public AnnotatedElement getAnnotatedType(Object recordComponent)
Resolves a record component's annotated type.- Specified by:
getAnnotatedTypein interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher- Parameters:
recordComponent- The record component to resolve the annotated type for.- Returns:
- The record component's annotated type.
-
-