java.lang.Object
com.gpudb.TypeObjectMap.MethodHandler
All Implemented Interfaces:
Enclosing class:
public static final class TypeObjectMap.MethodHandler extends Object implements TypeObjectMap.Accessor, TypeObjectMap.Mutator
A combined
TypeObjectMap.Accessor and TypeObjectMap.Mutator that provides access to a field via specified get and set methods using reflection. The get method must be public and take no parameters, and the set method must be public and take one parameter of the same type returned by the get method.Constructor Summary
ConstructorsConstructorDescriptionMethodHandler(Method getMethod, Method setMethod) Creates aTypeObjectMap.MethodHandlerfor the specified get and set methods.Method Summary
Constructor Details
MethodHandler
Creates aTypeObjectMap.MethodHandlerfor the specified get and set methods. The get method must be public and take no parameters, and the set method must be public and take one parameter of the same type returned by the get method.Parameters:getMethod- the get methodsetMethod- the set methodThrows:IllegalArgumentException- if the specified methods are not of the correct form
Method Details
get
Returns a value from the specified object via the get method specified in the constructor. The object must belong to the class containing the method.Specified by:getin interfaceTypeObjectMap.AccessorParameters:o- the objectReturns:the value returned by the get methodThrows:GPUdbRuntimeException- if the value could not be retrievedset
Sets a value in the specified object via the set method specified in the constructor. The object must belong to the class containing the method.Specified by:setin interfaceTypeObjectMap.MutatorParameters:o- the objectvalue- the new value of the fieldThrows:GPUdbRuntimeException- if the value could not be set