- java.lang.Object
-
- org.github.gestalt.config.utils.RecComponent
-
public final class RecComponent extends java.lang.ObjectA record component, which has a name, a type and an index.(If running on Java 14+, this should be a record class ;) )
The latter is the index of the record components in the class file's record attribute, required to invoke the record's canonical constructor.
-
-
Constructor Summary
Constructors Constructor Description RecComponent(java.lang.String name, java.lang.reflect.Type type, java.lang.Class<?> klass, java.lang.annotation.Annotation[] annotations, java.lang.reflect.Method accessor, int index)Create a Record component.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.MethodgetAccessor()Returns a Method that represents the accessor for this record component.java.lang.annotation.Annotation[]getDeclaredAnnotations()Returns annotations that are directly present on this element.intindex()get the index of the Record component.java.lang.Stringname()get the name of the Record component.java.lang.Class<?>type()get the class of the Record component.java.lang.reflect.TypetypeGeneric()get the type of the Record component.
-
-
-
Constructor Detail
-
RecComponent
public RecComponent(java.lang.String name, java.lang.reflect.Type type, java.lang.Class<?> klass, java.lang.annotation.Annotation[] annotations, java.lang.reflect.Method accessor, int index)Create a Record component.- Parameters:
name- name of the Record componenttype- type of Record componentklass- class of the Record componentannotations- Annotations on the componentaccessor- Accessor for this record component.index- index of the Record component
-
-
Method Detail
-
name
public java.lang.String name()
get the name of the Record component.- Returns:
- name of the Record component
-
typeGeneric
public java.lang.reflect.Type typeGeneric()
get the type of the Record component.- Returns:
- type of the Record component
-
index
public int index()
get the index of the Record component.- Returns:
- index of the Record component
-
type
public java.lang.Class<?> type()
get the class of the Record component.- Returns:
- class of the Record component
-
getDeclaredAnnotations
public java.lang.annotation.Annotation[] getDeclaredAnnotations()
Returns annotations that are directly present on this element.- Returns:
- Returns annotations that are directly present on this element.
-
getAccessor
public java.lang.reflect.Method getAccessor()
Returns a Method that represents the accessor for this record component.- Returns:
- Returns a Method that represents the accessor for this record component.
-
-