Java SDK Documentation  24.2.0
com.vertica.sdk.NullTypeCoercion Class Reference
Inheritance diagram for com.vertica.sdk.NullTypeCoercion:
Inheritance graph
Collaboration diagram for com.vertica.sdk.NullTypeCoercion:
Collaboration graph

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< TypeCoercionPolicygetPolicy ()
 
void setPolicy (Collection< TypeCoercionPolicy > policy)
 

Protected Member Functions

Collection< TypeCoercionPolicygetDefaultPolicy ()
 
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)

◆ getMapIterator()

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

◆ 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()

◆ 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
policyThe 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