org.h2.value

## Class ValueNull

- java.lang.Object
- - org.h2.value.VersionedValue
  - - org.h2.value.Value
    - - org.h2.value.ValueNull

    public class ValueNull
    extends Value

Implementation of NULL. NULL is not a regular data type.

### Field Summary

Fields
`static ValueNull` `INSTANCE` The main NULL instance.

### Fields inherited from class org.h2.value.Value

`ARRAY, BLOB, BOOLEAN, BYTE, BYTES, CLOB, DATE, DECIMAL, DOUBLE, ENUM, FLOAT, GEOMETRY, INT, INTERVAL_DAY, INTERVAL_DAY_TO_HOUR, INTERVAL_DAY_TO_MINUTE, INTERVAL_DAY_TO_SECOND, INTERVAL_HOUR, INTERVAL_HOUR_TO_MINUTE, INTERVAL_HOUR_TO_SECOND, INTERVAL_MINUTE, INTERVAL_MINUTE_TO_SECOND, INTERVAL_MONTH, INTERVAL_SECOND, INTERVAL_YEAR, INTERVAL_YEAR_TO_MONTH, JAVA_OBJECT, JSON, LONG, MIN_LONG_DECIMAL, NULL, RESULT_SET, ROW, SHORT, STRING, STRING_FIXED, STRING_IGNORECASE, TIME, TIME_TZ, TIMESTAMP, TIMESTAMP_TZ, TYPE_COUNT, UNKNOWN, UUID`

### Fields inherited from class org.h2.value.VersionedValue

`DUMMY`

### Method Summary

Methods
`int` `compareTypeSafe(Value v, CompareMode mode, CastDataProvider provider)` Compare this value against another value given that the values are of the same data type.
`boolean` `containsNull()` Returns true if this value is NULL or contains NULL value.
`protected Value` `convertTo(int targetType, ExtTypeInfo extTypeInfo, CastDataProvider provider, boolean forComparison, java.lang.Object column)` Convert a value to the specified type.
`boolean` `equals(java.lang.Object other)` Check if the two values have the same hash code.
`java.math.BigDecimal` `getBigDecimal()`
`boolean` `getBoolean()`
`byte` `getByte()`
`byte[]` `getBytes()`
`java.sql.Date` `getDate(java.util.TimeZone timeZone)` Get the date value converted to the specified timezone.
`double` `getDouble()`
`float` `getFloat()`
`java.io.InputStream` `getInputStream()`
`int` `getInt()`
`long` `getLong()`
`int` `getMemory()` Get the memory used by this object.
`java.lang.Object` `getObject()` Get the value as an object.
`java.io.Reader` `getReader()`
`short` `getShort()`
`java.lang.StringBuilder` `getSQL(java.lang.StringBuilder builder)` Appends the SQL expression for this value to the specified builder.
`java.lang.String` `getString()` Get the value as a string.
`java.sql.Time` `getTime(java.util.TimeZone timeZone)` Get the time value converted to the specified timezone.
`java.sql.Timestamp` `getTimestamp(java.util.TimeZone timeZone)` Get the timezone value converted to the specified timezone.
`TypeInfo` `getType()` Returns the data type.
`int` `getValueType()` Get the value type.
`int` `hashCode()`
`void` `set(java.sql.PreparedStatement prep, int parameterIndex)` Set the value as a parameter in a prepared statement.

### Methods inherited from class org.h2.value.Value

`add, checkPrecision, clearCache, compareTo, compareWithNull, convertPrecision, convertScale, convertTo, convertTo, convertTo, convertToInt, copy, copyToResult, copyToTemp, divide, getBytesNoCopy, getDataHandler, getHigherOrder, getHigherType, getInputStream, getReader, getResult, getSignum, getSmall, getSQL, getTableId, getTraceSQL, getUnsupportedExceptionForOperation, isLinkedToTable, modulus, multiply, negate, remove, subtract, toString`

### Methods inherited from class org.h2.value.VersionedValue

`getCommittedValue, getCurrentValue, getOperationId, isCommitted`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### INSTANCE

    public static final ValueNull INSTANCE

The main NULL instance.

### Method Detail

#### getSQL

    public java.lang.StringBuilder getSQL(java.lang.StringBuilder builder)

Description copied from class: `Value`
Appends the SQL expression for this value to the specified builder.

Specified by:
  `getSQL` in class `Value`
Parameters:
  `builder` - string builder
Returns:
  the specified string builder

#### getType

    public TypeInfo getType()

Description copied from class: `Value`
Returns the data type.

Specified by:
  `getType` in class `Value`
Returns:
  the data type

#### getValueType

    public int getValueType()

Description copied from class: `Value`
Get the value type.

Specified by:
  `getValueType` in class `Value`
Returns:
  the value type

#### getMemory

    public int getMemory()

Description copied from class: `Value`
Get the memory used by this object.

Overrides:
  `getMemory` in class `Value`
Returns:
  the memory used in bytes

#### getString

    public java.lang.String getString()

Description copied from class: `Value`
Get the value as a string.

Specified by:
  `getString` in class `Value`
Returns:
  the string

#### getBoolean

    public boolean getBoolean()

Overrides:
  `getBoolean` in class `Value`

#### getDate

    public java.sql.Date getDate(java.util.TimeZone timeZone)

Description copied from class: `Value`
Get the date value converted to the specified timezone.

Overrides:
  `getDate` in class `Value`
Parameters:
  `timeZone` - the target timezone
Returns:
  the date

#### getTime

    public java.sql.Time getTime(java.util.TimeZone timeZone)

Description copied from class: `Value`
Get the time value converted to the specified timezone.

Overrides:
  `getTime` in class `Value`
Parameters:
  `timeZone` - the target timezone
Returns:
  the date

#### getTimestamp

    public java.sql.Timestamp getTimestamp(java.util.TimeZone timeZone)

Description copied from class: `Value`
Get the timezone value converted to the specified timezone.

Overrides:
  `getTimestamp` in class `Value`
Parameters:
  `timeZone` - the target timezone
Returns:
  the date

#### getBytes

    public byte[] getBytes()

Overrides:
  `getBytes` in class `Value`

#### getByte

    public byte getByte()

Overrides:
  `getByte` in class `Value`

#### getShort

    public short getShort()

Overrides:
  `getShort` in class `Value`

#### getBigDecimal

    public java.math.BigDecimal getBigDecimal()

Overrides:
  `getBigDecimal` in class `Value`

#### getDouble

    public double getDouble()

Overrides:
  `getDouble` in class `Value`

#### getFloat

    public float getFloat()

Overrides:
  `getFloat` in class `Value`

#### getInt

    public int getInt()

Overrides:
  `getInt` in class `Value`

#### getLong

    public long getLong()

Overrides:
  `getLong` in class `Value`

#### getInputStream

    public java.io.InputStream getInputStream()

Overrides:
  `getInputStream` in class `Value`

#### getReader

    public java.io.Reader getReader()

Overrides:
  `getReader` in class `Value`

#### convertTo

    protected Value convertTo(int targetType,
                  ExtTypeInfo extTypeInfo,
                  CastDataProvider provider,
                  boolean forComparison,
                  java.lang.Object column)

Description copied from class: `Value`
Convert a value to the specified type.

Overrides:
  `convertTo` in class `Value`
Parameters:
  `targetType` - the type of the returned value
  `extTypeInfo` - the extended data type information, or null
  `provider` - the cast information provider
  `forComparison` - if `true`, perform cast for comparison operation
  `column` - the column (if any), used for to improve the error message if conversion fails
Returns:
  the converted value

#### compareTypeSafe

    public int compareTypeSafe(Value v,
                      CompareMode mode,
                      CastDataProvider provider)

Description copied from class: `Value`
Compare this value against another value given that the values are of the same data type.

Specified by:
  `compareTypeSafe` in class `Value`
Parameters:
  `v` - the other value
  `mode` - the compare mode
  `provider` - the cast information provider
Returns:
  0 if both values are equal, -1 if the other value is smaller, and 1 otherwise

#### containsNull

    public boolean containsNull()

Description copied from class: `Value`
Returns true if this value is NULL or contains NULL value.

Overrides:
  `containsNull` in class `Value`
Returns:
  true if this value is NULL or contains NULL value

#### hashCode

    public int hashCode()

Specified by:
  `hashCode` in class `Value`

#### getObject

    public java.lang.Object getObject()

Description copied from class: `Value`
Get the value as an object.

Specified by:
  `getObject` in class `Value`
Returns:
  the object

#### set

    public void set(java.sql.PreparedStatement prep,
           int parameterIndex)
             throws java.sql.SQLException

Description copied from class: `Value`
Set the value as a parameter in a prepared statement.

Specified by:
  `set` in class `Value`
Parameters:
  `prep` - the prepared statement
  `parameterIndex` - the parameter index
Throws:
  `java.sql.SQLException`

#### equals

    public boolean equals(java.lang.Object other)

Description copied from class: `Value`
Check if the two values have the same hash code. No data conversion is made; this method returns false if the other object is not of the same class. For some values, compareTo may return 0 even if equals return false. Example: ValueDecimal 0.0 and 0.00.

Specified by:
  `equals` in class `Value`
Parameters:
  `other` - the other value
Returns:
  true if they are equal