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.Method
getAccessor
Thejava.lang.reflect.RecordComponent#getAccessor()
method.private java.lang.reflect.Method
getAnnotatedType
Thejava.lang.reflect.RecordComponent#getAnnotatedType()
method.private java.lang.reflect.Method
getDeclaringType
Thejava.lang.reflect.RecordComponent#getDeclaringType()
method.private java.lang.reflect.Method
getGenericSignature
Thejava.lang.reflect.RecordComponent#getGenericSignature()
method.private java.lang.reflect.Method
getGenericType
Thejava.lang.reflect.RecordComponent#getGenericType()
method.private java.lang.reflect.Method
getName
Thejava.lang.reflect.RecordComponent#getName()
method.private java.lang.reflect.Method
getRecordComponents
Thejava.lang.Class#getRecordComponents()
method.private java.lang.reflect.Method
getType
Thejava.lang.reflect.RecordComponent#getType()
method.private java.lang.reflect.Method
isRecord
Thejava.lang.Class#isRecord()
method.private java.lang.Class<?>
recordComponent
Thejava.lang.reflect.RecordComponent
type.
-
Constructor Summary
Constructors Modifier Constructor Description 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.
-
Method Summary
All Methods Instance Methods Concrete 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.
-
-
-
Field Detail
-
recordComponent
private final java.lang.Class<?> recordComponent
Thejava.lang.reflect.RecordComponent
type.
-
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.RecordComponent
type.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:
isInstance
in interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher
- Parameters:
instance
- The instance to evaluate.- Returns:
true
if 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:
getRecordComponents
in 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:
isRecord
in interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher
- Parameters:
type
- The type to resolve.- Returns:
true
if the supplied type is a record.
-
getName
public java.lang.String getName(java.lang.Object recordComponent)
Resolves a record component's name.- Specified by:
getName
in 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:
getDeclaringType
in 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:
getAccessor
in 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:
getType
in 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:
getGenericType
in 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:
getGenericSignature
in interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher
- 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
public java.lang.reflect.AnnotatedElement getAnnotatedType(java.lang.Object recordComponent)
Resolves a record component's annotated type.- Specified by:
getAnnotatedType
in interfaceRecordComponentDescription.ForLoadedRecordComponent.Dispatcher
- Parameters:
recordComponent
- The record component to resolve the annotated type for.- Returns:
- The record component's annotated type.
-
-