NullableObject

public class NullableObject

NullableObject is a wrapper class for any object which has a corresponding SQL type. It indicates if the object wrapped is null and provide the type, java.sql.Types, information of the object.

Constructors

NullableObject

public NullableObject(Object o, int type)

Creates a new instance of NullableObject.

Parameters:
  • o – The object to be wrapped by this NullableObject.
  • type – The type of the object to be wrapped.

Methods

getObject

public Object getObject()

Retrieves the object wrapped by this NullableObject.

Returns:the object wrapped.

getType

public int getType()

Retrieves the type information of the object wrapped.

Returns:the type information of the object wrapped. -1 if not specified in the creation of this instance.

isNull

public boolean isNull()

Reports whether the wrapped object is null.

Returns:true if the object wrapped is null and false if it is not.

toString

public String toString()

Returns a string representation of the object wrapped.

Returns:a string representation of the object wrapped. ‘null’ if the object wrapped is null.