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 java.lang.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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.MethodgetAccessorThejava.lang.reflect.RecordComponent#getAccessor()method.private java.lang.reflect.MethodgetAnnotatedTypeThejava.lang.reflect.RecordComponent#getAnnotatedType()method.private java.lang.reflect.MethodgetDeclaringTypeThejava.lang.reflect.RecordComponent#getDeclaringType()method.private java.lang.reflect.MethodgetGenericSignatureThejava.lang.reflect.RecordComponent#getGenericSignature()method.private java.lang.reflect.MethodgetGenericTypeThejava.lang.reflect.RecordComponent#getGenericType()method.private java.lang.reflect.MethodgetNameThejava.lang.reflect.RecordComponent#getName()method.private java.lang.reflect.MethodgetRecordComponentsThejava.lang.Class#getRecordComponents()method.private java.lang.reflect.MethodgetTypeThejava.lang.reflect.RecordComponent#getType()method.private java.lang.reflect.MethodisRecordThejava.lang.Class#isRecord()method.private java.lang.Class<?>recordComponentThejava.lang.reflect.RecordComponenttype.
-
Constructor Summary
Constructors Modifier Constructor Description protectedForJava14CapableVm(java.lang.Class<?> recordComponent, java.lang.reflect.Method getRecordComponents, java.lang.reflect.Method isRecord, java.lang.reflect.Method getName, java.lang.reflect.Method getDeclaringType, java.lang.reflect.Method getAccessor, java.lang.reflect.Method getType, java.lang.reflect.Method getGenericType, java.lang.reflect.Method getGenericSignature, java.lang.reflect.Method getAnnotatedType)Creates a dispatcher for a Java 14 capable VM.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
recordComponent
private final java.lang.Class<?> recordComponent
Thejava.lang.reflect.RecordComponenttype.
-
getRecordComponents
private final java.lang.reflect.Method getRecordComponents
Thejava.lang.Class#getRecordComponents()method.
-
isRecord
private final java.lang.reflect.Method isRecord
Thejava.lang.Class#isRecord()method.
-
getName
private final java.lang.reflect.Method getName
Thejava.lang.reflect.RecordComponent#getName()method.
-
getDeclaringType
private final java.lang.reflect.Method getDeclaringType
Thejava.lang.reflect.RecordComponent#getDeclaringType()method.
-
getAccessor
private final java.lang.reflect.Method getAccessor
Thejava.lang.reflect.RecordComponent#getAccessor()method.
-
getType
private final java.lang.reflect.Method getType
Thejava.lang.reflect.RecordComponent#getType()method.
-
getGenericType
private final java.lang.reflect.Method getGenericType
Thejava.lang.reflect.RecordComponent#getGenericType()method.
-
getGenericSignature
private final java.lang.reflect.Method getGenericSignature
Thejava.lang.reflect.RecordComponent#getGenericSignature()method.
-
getAnnotatedType
private final java.lang.reflect.Method getAnnotatedType
Thejava.lang.reflect.RecordComponent#getAnnotatedType()method.
-
-
Constructor Detail
-
ForJava14CapableVm
protected ForJava14CapableVm(java.lang.Class<?> recordComponent, java.lang.reflect.Method getRecordComponents, java.lang.reflect.Method isRecord, java.lang.reflect.Method getName, java.lang.reflect.Method getDeclaringType, java.lang.reflect.Method getAccessor, java.lang.reflect.Method getType, java.lang.reflect.Method getGenericType, java.lang.reflect.Method getGenericSignature, java.lang.reflect.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(java.lang.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 java.lang.Object[] getRecordComponents(java.lang.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(java.lang.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 java.lang.String getName(java.lang.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 java.lang.Class<?> getDeclaringType(java.lang.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 java.lang.reflect.Method getAccessor(java.lang.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 java.lang.Class<?> getType(java.lang.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 java.lang.reflect.Type getGenericType(java.lang.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 java.lang.String getGenericSignature(java.lang.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 java.lang.reflect.AnnotatedElement getAnnotatedType(java.lang.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.
-
-