Package org.postgresql.jdbc
Class BooleanTypeUtil
java.lang.Object
org.postgresql.jdbc.BooleanTypeUtil
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static PSQLException
cannotCoerceException
(Object value) (package private) static boolean
castToBoolean
(Object in) Cast an Object value to the corresponding boolean value.private static boolean
fromCharacter
(Character charval) private static boolean
fromNumber
(Number numval) (package private) static boolean
fromString
(String strval)
-
Field Details
-
LOGGER
-
-
Constructor Details
-
BooleanTypeUtil
private BooleanTypeUtil()
-
-
Method Details
-
castToBoolean
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
- Throws:
PSQLException
-
fromCharacter
- Throws:
PSQLException
-
fromNumber
- Throws:
PSQLException
-
cannotCoerceException
-