public interface FieldWrapper
A wrapper interface for accessing and manipulating object fields.
This interface provides a unified way to get and set field values on objects, abstracting the underlying reflection operations. It handles different types of fields including regular fields and optional fields, providing type-safe access patterns.
Implementations of this interface are typically created by PropertyPathSegment
implementations to handle field access for specific property path segments.
This interface is used internally by the Doma framework for property mapping and should not be used directly by application code.
- See Also:
-
Method Summary
-
Method Details
-
get
Retrieves the value of this field from the specified object.- Parameters:
obj- the object from which to retrieve the field value- Returns:
- the field value, which may be null
- Throws:
WrapException- if an error occurs during field access
-
set
Sets the value of this field on the specified object.- Parameters:
obj- the object on which to set the field valuevalue- the value to set, which may be null- Throws:
WrapException- if an error occurs during field access
-
getType
Class<?> getType()Returns the type of this field.For optional fields, this returns the element type rather than the Optional type itself.
- Returns:
- the field type
-