java.lang.Object
com.gpudb.TypeObjectMap.ConvertingFieldHandler
All Implemented Interfaces:
Enclosing class:
public static final class TypeObjectMap.ConvertingFieldHandler extends Object implements TypeObjectMap.Accessor, TypeObjectMap.Mutator
A combined
TypeObjectMap.Accessor and TypeObjectMap.Mutator that provides access to a specified field using reflection, converting the value to and from the data type of a specified GPUdb column.Constructor Summary
ConstructorsConstructorDescriptionConvertingFieldHandler(Field field, Type.Column column) Creates aTypeObjectMap.ConvertingFieldHandlerfor the specified field and GPUdbcolumn.Method Summary
Modifier and TypeMethodDescriptionReturns the value of the field specified in the constructor from the specified object, converting it to the data type of the GPUdbcolumnspecified in the constructor.voidSets the value of the field specified in the constructor in the specified object after converting it from the data type of the GPUdbcolumnspecified in the constructor.
Constructor Details
ConvertingFieldHandler
Creates aTypeObjectMap.ConvertingFieldHandlerfor the specified field and GPUdbcolumn. Field values will be converted to and from the data type of the column.Parameters:field- the fieldcolumn- the columnThrows:IllegalArgumentException- if the field does not have a data type that is supported for conversion
Method Details
get
Returns the value of the field specified in the constructor from the specified object, converting it to the data type of the GPUdbcolumnspecified in the constructor. The object must belong to the class containing the field.Specified by:getin interfaceTypeObjectMap.AccessorParameters:o- the objectReturns:the converted value of the fieldThrows:GPUdbRuntimeException- if the value could not be retrievedset
Sets the value of the field specified in the constructor in the specified object after converting it from the data type of the GPUdbcolumnspecified in the constructor. The object must belong to the class containing the field.Specified by:setin interfaceTypeObjectMap.MutatorParameters:o- the objectvalue- the unconverted new value of the fieldThrows:GPUdbRuntimeException- if the value could not be set