Top Description Fields Constructors Methods
org.postgresql.jdbc

pack-priv Class BooleanTypeUtil

extends Object
Class Inheritance
Imports
org.postgresql.util.GT, .PSQLException, .PSQLState, java.util.logging.Level, .Logger

Helper class to handle boolean type of PostgreSQL.

Based on values accepted by the PostgreSQL server: https://www.postgresql.org/docs/current/static/datatype-boolean.html

Field Summary

Modifier and TypeField and Description
private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static PSQLException
pack-priv static boolean

Returns:

boolean value corresponding to the cast of the object
castToBoolean
(final Object
Object to cast into boolean
in
)

Cast an Object value to the corresponding boolean value.

private static boolean
fromCharacter(final Character charval)

private static boolean
fromNumber(final Number numval)

pack-priv static boolean
fromString(final String strval)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

BooleanTypeUtilback to summary
private BooleanTypeUtil()

Method Detail

cannotCoerceExceptionback to summary
private static PSQLException cannotCoerceException(final Object value)
castToBooleanback to summary
pack-priv static boolean castToBoolean(final Object in) throws PSQLException

Cast an Object value to the corresponding boolean value.

Parameters
in:Object

Object to cast into boolean

Returns:boolean

boolean value corresponding to the cast of the object

Exceptions
PSQLException:
PSQLState.CANNOT_COERCE
fromCharacterback to summary
private static boolean fromCharacter(final Character charval) throws PSQLException
fromNumberback to summary
private static boolean fromNumber(final Number numval) throws PSQLException
fromStringback to summary
pack-priv static boolean fromString(final String strval) throws PSQLException