Package com.fauna.mapping
Class FieldInfo
- java.lang.Object
-
- com.fauna.mapping.FieldInfo
-
public final class FieldInfo extends java.lang.ObjectRepresents metadata for a Fauna document field in a class, including its name, type, associated codec, and other properties used for serialization and deserialization.
-
-
Constructor Summary
Constructors Constructor Description FieldInfo(java.lang.reflect.Field field, java.lang.String name, java.lang.Class<?> clazz, java.lang.reflect.Type[] genericTypeArgs, CodecProvider provider, FieldType fieldType)Constructs aFieldInfoobject with the specified field metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CodecgetCodec()Retrieves the codec used to serialize and deserialize the field.java.lang.reflect.FieldgetField()Retrieves theFieldobject representing this field in the class.FieldTypegetFieldType()Retrieves theFieldTypeof this field.java.lang.StringgetName()Retrieves the name of the field.java.lang.Class<?>getType()Retrieves the class type of the field.
-
-
-
Constructor Detail
-
FieldInfo
public FieldInfo(java.lang.reflect.Field field, java.lang.String name, java.lang.Class<?> clazz, java.lang.reflect.Type[] genericTypeArgs, CodecProvider provider, FieldType fieldType)Constructs aFieldInfoobject with the specified field metadata.- Parameters:
field- The field represented by thisFieldInfoinstance.name- The name of the field.clazz- The class type of the field.genericTypeArgs- An array of generic type arguments for the field, if any.provider- TheCodecProviderused to obtain a codec for this field.fieldType- TheFieldTypeof the field.
-
-
Method Detail
-
getName
public java.lang.String getName()
Retrieves the name of the field.- Returns:
- A
Stringrepresenting the field name.
-
getType
public java.lang.Class<?> getType()
Retrieves the class type of the field.- Returns:
- A
Class<?>representing the field's class type.
-
getFieldType
public FieldType getFieldType()
Retrieves theFieldTypeof this field.- Returns:
- The
FieldTypeassociated with this field.
-
getCodec
public Codec getCodec()
Retrieves the codec used to serialize and deserialize the field. If the codec is not already set, it will be retrieved from theCodecProviderand cached.- Returns:
- A
Codecinstance associated with the field type.
-
getField
public java.lang.reflect.Field getField()
Retrieves theFieldobject representing this field in the class.- Returns:
- The
Fieldassociated with thisFieldInfo.
-
-