public static final class TypeObjectMap.ConvertingFieldHandler extends Object implements TypeObjectMap.Accessor, TypeObjectMap.Mutator
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 and Description |
---|
ConvertingFieldHandler(Field field,
Type.Column column)
Creates a
TypeObjectMap.ConvertingFieldHandler for the specified field and
GPUdb column . |
Modifier and Type | Method and Description |
---|---|
Object |
get(Object o)
Returns the value of the field specified in the constructor from the
specified object, converting it to the data type of the GPUdb
column specified in the constructor. |
void |
set(Object o,
Object value)
Sets the value of the field specified in the constructor in the
specified object after converting it from the data type of the GPUdb
column specified in the constructor. |
public ConvertingFieldHandler(Field field, Type.Column column)
TypeObjectMap.ConvertingFieldHandler
for the specified field and
GPUdb column
. Field values will be converted to
and from the data type of the column.field
- the fieldcolumn
- the columnIllegalArgumentException
- if the field does not have a data
type that is supported for conversionpublic Object get(Object o)
column
specified in the constructor. The object
must belong to the class containing the field.get
in interface TypeObjectMap.Accessor
o
- the objectGPUdbRuntimeException
- if the value could not be retrievedpublic void set(Object o, Object value)
column
specified in the constructor. The object
must belong to the class containing the field.set
in interface TypeObjectMap.Mutator
o
- the objectvalue
- the unconverted new value of the fieldGPUdbRuntimeException
- if the value could not be setCopyright © 2019. All rights reserved.