public interface FieldInfo
| Modifier and Type | Method and Description |
|---|---|
BracketType |
bracketType()
Returns the
BracketType used by the serialization strategy associated
with this FieldInfo object. |
default void |
copy(Object source,
Object destination)
Copies the value of the field represented by this
FieldInfo object from
the source object to the destination object. |
static FieldInfo |
createForField(String name,
Class<?> type,
BracketType bracketType,
@NotNull Field field) |
Class<?> |
genericType(int index)
Retrieves the
Class identifying the declared generic type of the
field represented by this FieldInfo object at the provided index. |
@Nullable Object |
get(Object object)
Returns the value of the field represented by this
FieldInfo object
as an Object. |
char |
getChar(Object object)
Returns the value of the field represented by this
FieldInfo object
as a char primitive. |
double |
getDouble(Object object)
Returns the value of the field represented by this
FieldInfo object
as a double primitive. |
int |
getInt(Object object)
Returns the value of the field represented by this
FieldInfo object
as an int primitive. |
long |
getLong(Object object)
Returns the value of the field represented by this
FieldInfo object
as a long primitive. |
boolean |
isEqual(Object a,
Object b)
Compares the value of the field represented by this
FieldInfo in both provided
objects a and b and determines if they are equal. |
static net.openhft.chronicle.wire.Wires.FieldInfoPair |
lookupClass(@NotNull Class<?> aClass)
Looks up the meta-information of the fields associated with the provided class and returns
a pair of information encapsulated in
Wires.FieldInfoPair. |
String |
name()
Returns the name of the field represented by this
FieldInfo object. |
void |
set(Object object,
char value)
Sets the value of the field represented by this
FieldInfo object
to the provided value. |
void |
set(Object object,
double value)
Sets the value of the field represented by this
FieldInfo object
to the provided value of type double. |
void |
set(Object object,
int value)
Sets the value of the field represented by this
FieldInfo object
to the provided value. |
void |
set(Object object,
long value)
Sets the value of the field represented by this
FieldInfo object
to the provided value of type long. |
void |
set(Object object,
Object value)
Sets the value of the field represented by this
FieldInfo object
to the provided value. |
Class<?> |
type()
Returns a
Class identifying the declared type of the field
represented by this FieldInfo object. |
static FieldInfo createForField(String name, Class<?> type, BracketType bracketType, @NotNull @NotNull Field field)
@NotNull
static net.openhft.chronicle.wire.Wires.FieldInfoPair lookupClass(@NotNull
@NotNull Class<?> aClass)
Wires.FieldInfoPair.aClass - The class for which field info needs to be retrieved.Wires.FieldInfoPair representing the field information of the class.String name()
FieldInfo object.FieldInfo object.Class<?> type()
Class identifying the declared type of the field
represented by this FieldInfo object.Class identifying the declared type of the field
represented by this FieldInfo object.BracketType bracketType()
BracketType used by the serialization strategy associated
with this FieldInfo object.BracketType used by the serialization strategy associated
with this FieldInfo object.@Nullable @Nullable Object get(Object object)
FieldInfo object
as an Object. The provided object is used as a target to
extract the field from.FieldInfo object
as an Object.long getLong(Object object)
FieldInfo object
as a long primitive. The provided object is used as a target
to extract the field from.FieldInfo object
as a long primitive.int getInt(Object object)
FieldInfo object
as an int primitive. The provided object is used as a target
to extract the field from.FieldInfo object
as an int primitive.char getChar(Object object)
FieldInfo object
as a char primitive. The provided object is used as a target
to extract the field from.FieldInfo object
as a char primitive.double getDouble(Object object)
FieldInfo object
as a double primitive. The provided object is used as a target
to extract the field from.FieldInfo object
as a double primitive.void set(Object object, Object value) throws IllegalArgumentException
FieldInfo object
to the provided value. The provided object is used as a
target to the extract eh field from.IllegalArgumentExceptionvoid set(Object object, char value) throws IllegalArgumentException
FieldInfo object
to the provided value. The provided object is used as a
target to the extract eh field from.IllegalArgumentExceptionvoid set(Object object, int value) throws IllegalArgumentException
FieldInfo object
to the provided value. The provided object is used as a
target to the extract eh field from.IllegalArgumentExceptionvoid set(Object object, long value) throws IllegalArgumentException
FieldInfo object
to the provided value of type long. The provided object is used as a
target from which the field is extracted.object - The object containing the field to be set.value - The value to set the field to.IllegalArgumentException - if the specified object is not an instance of the class or
interface declaring the underlying field, or if an unwrapping
conversion fails.void set(Object object, double value) throws IllegalArgumentException
FieldInfo object
to the provided value of type double. The provided object is used as a
target from which the field is extracted.object - The object containing the field to be set.value - The value to set the field to.IllegalArgumentException - if the specified object is not an instance of the class or
interface declaring the underlying field, or if an unwrapping
conversion fails.Class<?> genericType(int index)
Class identifying the declared generic type of the
field represented by this FieldInfo object at the provided index.index - The index of the generic type to be retrieved.Class identifying the declared generic type of the field represented by
this FieldInfo object at the provided index.default void copy(Object source, Object destination)
FieldInfo object from
the source object to the destination object. It's a shallow copy, so objects will be
copied by reference.source - The object from which the field value is to be copied.destination - The object to which the field value is to be copied.boolean isEqual(Object a, Object b)
FieldInfo in both provided
objects a and b and determines if they are equal.a - First object to compare the field's value.b - Second object to compare the field's value.true if the values are equal, false otherwise.Copyright © 2024. All rights reserved.