![]() |
Java SDK Documentation
23.3.0
|


Public Member Functions | |
| NullTypeCoercion () | |
| ByteBuffer | asBinaryBytes (Object value, int length, VerticaType type) |
| Boolean | asBoolean (Object value, VerticaType type) |
| ByteBuffer | asCharBytes (Object value, int length, VerticaType type) |
| java.sql.Date | asDate (Object value, VerticaType type) |
| Double | asDouble (Object value, VerticaType type) |
| Long | asLong (Object value, VerticaType type) |
| java.sql.Timestamp | asTimestamp (Object value, VerticaType type) |
| Iterator< Object > | getListIterator (Object value) |
| Iterator< Map.Entry< String, Object > > | getMapIterator (Object value) |
| MetaType | getMetaType (Object value) |
| Set< TypeCoercionPolicy > | getPolicy () |
| void | setPolicy (Collection< TypeCoercionPolicy > policy) |
Protected Member Functions | |
| Collection< TypeCoercionPolicy > | getDefaultPolicy () |
| void | unsupportedType (Object value, VerticaType type) |
An implementation of TypeCoercion that always returns null. By default, it has an empty policy, causing all attempts to return null without raising any exceptions under any circumstances.
If FAIL_UNSUPPORTED_TYPE is added to the policy, all coercions will raise exceptions.
This is a good choice for a superclass for users implementing their own type coercion and not interesting in using any standard type coercion. In that case, use of FAIL_UNSUPPORTED_TYPE is recommended to identify gaps in support. For a more functional starting point, see NoopTypeCoercion.
| com.vertica.sdk.NullTypeCoercion.NullTypeCoercion | ( | ) |
Constructor. Initializes this TypeCoercion with an empty policy.
| ByteBuffer com.vertica.sdk.NullTypeCoercion.asBinaryBytes | ( | Object | value, |
| int | length, | ||
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| Boolean com.vertica.sdk.NullTypeCoercion.asBoolean | ( | Object | value, |
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| ByteBuffer com.vertica.sdk.NullTypeCoercion.asCharBytes | ( | Object | value, |
| int | length, | ||
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| java.sql.Date com.vertica.sdk.NullTypeCoercion.asDate | ( | Object | value, |
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| Double com.vertica.sdk.NullTypeCoercion.asDouble | ( | Object | value, |
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| Long com.vertica.sdk.NullTypeCoercion.asLong | ( | Object | value, |
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
| java.sql.Timestamp com.vertica.sdk.NullTypeCoercion.asTimestamp | ( | Object | value, |
| VerticaType | type | ||
| ) |
Not supported; returns null or raises TypeCoercionException.
Implements com.vertica.sdk.TypeCoercion.
|
protected |
Provides the default policy installed by the constructor.
For NullTypeCoercion, this policy is empty.
Referenced by com.vertica.sdk.NullTypeCoercion.NullTypeCoercion().
| Iterator<Object> com.vertica.sdk.NullTypeCoercion.getListIterator | ( | Object | value | ) |
Not implemented on NullTypeCoercion. Throws UnsupportedOperationException.
Implements com.vertica.sdk.TypeCoercion.
| Iterator<Map.Entry<String,Object> > com.vertica.sdk.NullTypeCoercion.getMapIterator | ( | Object | value | ) |
Not implemented on NullTypeCoercion. Throws UnsupportedOperationException.
Implements com.vertica.sdk.TypeCoercion.
| MetaType com.vertica.sdk.NullTypeCoercion.getMetaType | ( | Object | value | ) |
Always returns SCALAR since this TypeCoercion doesn't know how to convert anything to LIST or MAP types.
Implements com.vertica.sdk.TypeCoercion.
| Set<TypeCoercionPolicy> com.vertica.sdk.NullTypeCoercion.getPolicy | ( | ) |
Returns an unmodifiable version of the policy.
Implements com.vertica.sdk.TypeCoercion.
Referenced by com.vertica.sdk.NoopTypeCoercion.asBinaryBytes(), com.vertica.sdk.NoopTypeCoercion.asCharBytes(), com.vertica.sdk.StandardTypeCoercion.asCharBytes(), com.vertica.sdk.NoopTypeCoercion.invalidInputType(), com.vertica.sdk.StandardTypeCoercion.invalidInputValue(), com.vertica.sdk.NullTypeCoercion.unsupportedType(), and com.vertica.sdk.NoopTypeCoercion.valueTooLarge().
| void com.vertica.sdk.NullTypeCoercion.setPolicy | ( | Collection< TypeCoercionPolicy > | policy | ) |
Sets the policies for this TypeCoercion instance. Policies generally dictate which scenarios generate exceptions and allow for different error handling choices without implementing a new TypeCoercion class.
| policy | The policy collection |
Implements com.vertica.sdk.TypeCoercion.
Referenced by com.vertica.sdk.NullTypeCoercion.NullTypeCoercion().
|
protected |
Throws a TypeCoercionException if the policy includes TypeCoercionPolicy#FAIL_UNSUPPORTED_TYPE. Otherwise does nothing.
| value | The value provided which could not be coerced. |
| type | The target Vertica type. |
Referenced by com.vertica.sdk.NullTypeCoercion.asBinaryBytes(), com.vertica.sdk.NullTypeCoercion.asBoolean(), com.vertica.sdk.NullTypeCoercion.asCharBytes(), com.vertica.sdk.NullTypeCoercion.asDate(), com.vertica.sdk.NullTypeCoercion.asDouble(), com.vertica.sdk.NullTypeCoercion.asLong(), and com.vertica.sdk.NullTypeCoercion.asTimestamp().