Vertica documentation is moving! Use our new documentation site at https://docs.rocketsoftware.com/bundle/vertica_24.2/page/index.html

com.vertica.sdk.NullTypeCoercion Class Reference

Inheritance diagram for com.vertica.sdk.NullTypeCoercion:

Collaboration diagram for com.vertica.sdk.NullTypeCoercion:

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)

Detailed Description

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.

Constructor & Destructor Documentation

◆NullTypeCoercion()

com.vertica.sdk.NullTypeCoercion.NullTypeCoercion()

Constructor. Initializes this TypeCoercion with an empty policy.

See also

getDefaultPolicy()

Member Function Documentation

◆asBinaryBytes()

ByteBuffer com.vertica.sdk.NullTypeCoercion.asBinaryBytes(Object value, int length, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asBoolean()

Boolean com.vertica.sdk.NullTypeCoercion.asBoolean(Object value, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asCharBytes()

ByteBuffer com.vertica.sdk.NullTypeCoercion.asCharBytes(Object value, int length, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asDate()

java.sql.Date com.vertica.sdk.NullTypeCoercion.asDate(Object value, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asDouble()

Double com.vertica.sdk.NullTypeCoercion.asDouble(Object value, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asLong()

Long com.vertica.sdk.NullTypeCoercion.asLong(Object value, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆asTimestamp()

java.sql.Timestamp com.vertica.sdk.NullTypeCoercion.asTimestamp(Object value, VerticaType type)

Not supported; returns null or raises TypeCoercionException.

Implements com.vertica.sdk.TypeCoercion.

◆getDefaultPolicy()

Collection<TypeCoercionPolicy> com.vertica.sdk.NullTypeCoercion.getDefaultPolicy()

protected

Provides the default policy installed by the constructor.

For NullTypeCoercion, this policy is empty.

Returns A new collection of the default policy for this instance of TypeCoercion.

See also

getPolicy() #setPolicy(Collection)

Referenced by com.vertica.sdk.NullTypeCoercion.NullTypeCoercion().

◆getListIterator()

Iterator<Object> com.vertica.sdk.NullTypeCoercion.getListIterator(Object value)

Not implemented on NullTypeCoercion. Throws UnsupportedOperationException.

Implements com.vertica.sdk.TypeCoercion.

◆getMapIterator()

Iterator<Map.Entry<String,Object> > com.vertica.sdk.NullTypeCoercion.getMapIterator(Object value)

Not implemented on NullTypeCoercion. Throws UnsupportedOperationException.

Implements com.vertica.sdk.TypeCoercion.

◆getMetaType()

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.

◆getPolicy()

Set<TypeCoercionPolicy> com.vertica.sdk.NullTypeCoercion.getPolicy()

Returns an unmodifiable version of the policy.

Returns The policy collection.

See also

setPolicy

Implements com.vertica.sdk.TypeCoercion.

Referenced by

◆setPolicy()

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.

Parameters

  • policy: The policy collection

See also

TypeCoercionPolicy

getPolicy()

Implements com.vertica.sdk.TypeCoercion.

Referenced by com.vertica.sdk.NullTypeCoercion.NullTypeCoercion().

◆unsupportedType()

void com.vertica.sdk.NullTypeCoercion.unsupportedType(Object value, VerticaType type)

protected

Throws a TypeCoercionException if the policy includes TypeCoercionPolicy#FAIL_UNSUPPORTED_TYPE. Otherwise does nothing.

Parameters

  • value: The value provided which could not be coerced.
  • type: The target Vertica type.

See also

getPolicy() #setPolicy(Collection)

Referenced by