Package com.fauna.mapping
Class FieldInfo
- java.lang.Object
-
- com.fauna.mapping.FieldInfo
-
public final class FieldInfo extends java.lang.Object
Represents 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 aFieldInfo
object with the specified field metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Codec
getCodec()
Retrieves the codec used to serialize and deserialize the field.java.lang.reflect.Field
getField()
Retrieves theField
object representing this field in the class.FieldType
getFieldType()
Retrieves theFieldType
of this field.java.lang.String
getName()
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 aFieldInfo
object with the specified field metadata.- Parameters:
field
- The field represented by thisFieldInfo
instance.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
- TheCodecProvider
used to obtain a codec for this field.fieldType
- TheFieldType
of the field.
-
-
Method Detail
-
getName
public java.lang.String getName()
Retrieves the name of the field.- Returns:
- A
String
representing 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 theFieldType
of this field.- Returns:
- The
FieldType
associated 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 theCodecProvider
and cached.- Returns:
- A
Codec
instance associated with the field type.
-
getField
public java.lang.reflect.Field getField()
Retrieves theField
object representing this field in the class.- Returns:
- The
Field
associated with thisFieldInfo
.
-
-