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 PSQLExceptioncannotCoerceException(Object value) (package private) static booleancastToBoolean(Object in) Cast an Object value to the corresponding boolean value.private static booleanfromCharacter(Character charval) private static booleanfromNumber(Number numval) (package private) static booleanfromString(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
-