Package com.gpudb
Class TypeObjectMap.FieldHandler
- java.lang.Object
-
- com.gpudb.TypeObjectMap.FieldHandler
-
- All Implemented Interfaces:
TypeObjectMap.Accessor,TypeObjectMap.Mutator
- Enclosing class:
- TypeObjectMap<T>
public static final class TypeObjectMap.FieldHandler extends Object implements TypeObjectMap.Accessor, TypeObjectMap.Mutator
A combinedTypeObjectMap.AccessorandTypeObjectMap.Mutatorthat provides access to a specified field using reflection. The field must be public.
-
-
Constructor Summary
Constructors Constructor Description FieldHandler(Field field)Creates aTypeObjectMap.FieldHandlerfor the specified field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectget(Object o)Returns the value of the field specified in the constructor from the specified object.voidset(Object o, Object value)Sets the value of the field specified in the constructor in the specified object.
-
-
-
Constructor Detail
-
FieldHandler
public FieldHandler(Field field)
Creates aTypeObjectMap.FieldHandlerfor the specified field.- Parameters:
field- the field
-
-
Method Detail
-
get
public Object get(Object o)
Returns the value of the field specified in the constructor from the specified object. The object must belong to the class containing the field.- Specified by:
getin interfaceTypeObjectMap.Accessor- Parameters:
o- the object- Returns:
- the value of the field
- Throws:
GPUdbRuntimeException- if the value could not be retrieved
-
set
public void set(Object o, Object value)
Sets the value of the field specified in the constructor in the specified object. The object must belong to the class containing the field.- Specified by:
setin interfaceTypeObjectMap.Mutator- Parameters:
o- the objectvalue- the new value of the field- Throws:
GPUdbRuntimeException- if the value could not be set
-
-