Package org.postgresql.jdbc
Class BooleanTypeUtil
- java.lang.Object
-
- org.postgresql.jdbc.BooleanTypeUtil
-
class BooleanTypeUtil extends java.lang.Object
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
Fields Modifier and Type Field Description private static java.util.logging.Logger
LOGGER
-
Constructor Summary
Constructors Modifier Constructor Description private
BooleanTypeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static PSQLException
cannotCoerceException(java.lang.Object value)
(package private) static boolean
castToBoolean(java.lang.Object in)
Cast an Object value to the corresponding boolean value.private static boolean
fromCharacter(java.lang.Character charval)
private static boolean
fromNumber(java.lang.Number numval)
(package private) static boolean
fromString(java.lang.String strval)
-
-
-
Method Detail
-
castToBoolean
static boolean castToBoolean(java.lang.Object in) throws PSQLException
Cast an Object value to the corresponding boolean value.- Parameters:
in
- Object to cast into boolean- Returns:
- boolean value corresponding to the cast of the object
- Throws:
PSQLException
- PSQLState.CANNOT_COERCE
-
fromString
static boolean fromString(java.lang.String strval) throws PSQLException
- Throws:
PSQLException
-
fromCharacter
private static boolean fromCharacter(java.lang.Character charval) throws PSQLException
- Throws:
PSQLException
-
fromNumber
private static boolean fromNumber(java.lang.Number numval) throws PSQLException
- Throws:
PSQLException
-
cannotCoerceException
private static PSQLException cannotCoerceException(java.lang.Object value)
-
-