java.lang.Object
org.litebridgedb.tracking.FieldAccessorChain
- All Implemented Interfaces:
FieldAccessor
Represents a chain of
FieldAccessor instances, allowing the traversal and manipulation of nested fields
of a data transfer object (DTO).
This class provides mechanisms to navigate nested structures while enabling read/write access to the chained fields.
-
Constructor Summary
ConstructorsConstructorDescriptionFieldAccessorChain(FieldAccessor parent, String fieldPath, ClassFieldAccessorCache classFieldAccessorCache) -
Method Summary
Modifier and TypeMethodDescriptionadd(FieldAccessor fieldAccessor) Class<?> dtoClass()Retrieves the parentClassof the DTO containing the field targeted by thisFieldAccessor.booleanClass<?>[]Returns an array ofClassobjects representing the generic types associated with the field or property represented by thisFieldAccessor.@Nullable ObjectRetrieve the value of a field or property from the provided data transfer object (DTO).inthashCode()booleanisLast(FieldAccessor fieldAccessor) name()Return the name of the field or property represented by thisFieldAccessor.voidSet the value of a field or property for the provided data transfer object (DTO).subChain()toString()Class<?> type()Returns the declared type for the field represented by thisFieldAccessor.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.litebridgedb.tracking.FieldAccessor
genericType
-
Constructor Details
-
FieldAccessorChain
public FieldAccessorChain(FieldAccessor parent, String fieldPath, ClassFieldAccessorCache classFieldAccessorCache)
-
-
Method Details
-
fieldPath
-
fieldAccessors
-
subChain
-
add
-
isLast
-
name
Description copied from interface:FieldAccessorReturn the name of the field or property represented by thisFieldAccessor.- Specified by:
namein interfaceFieldAccessor- Returns:
- the name of the field or property as a
String
-
get
Description copied from interface:FieldAccessorRetrieve the value of a field or property from the provided data transfer object (DTO).- Specified by:
getin interfaceFieldAccessor- Parameters:
dto- the data transfer object from which to retrieve the field or property value. Must not be null and should conform to the structure expected by thisFieldAccessor.- Returns:
- the value of the field or property, or
nullif the field value is null or could not be accessed.
-
set
Description copied from interface:FieldAccessorSet the value of a field or property for the provided data transfer object (DTO).- Specified by:
setin interfaceFieldAccessor- Parameters:
dto- the data transfer object for which the field or property value will be set. Must not be null and should conform to the structure expected by thisFieldAccessor.value- the value to set for the field or property. May be null if the field or property allows null values.
-
type
Description copied from interface:FieldAccessorReturns the declared type for the field represented by thisFieldAccessor.- Specified by:
typein interfaceFieldAccessor- Returns:
- the field type
-
genericTypes
Description copied from interface:FieldAccessorReturns an array ofClassobjects representing the generic types associated with the field or property represented by thisFieldAccessor.- Specified by:
genericTypesin interfaceFieldAccessor- Returns:
- an array of
Classobjects that represent the generic types of the field or property, or an empty array if the field or property does not use generics.
-
dtoClass
Description copied from interface:FieldAccessorRetrieves the parentClassof the DTO containing the field targeted by thisFieldAccessor.- Specified by:
dtoClassin interfaceFieldAccessor- Returns:
- The parent DTO type
-
equals
-
hashCode
public int hashCode() -
toString
-