Class 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)  
      private static boolean fromString​(java.lang.String strval)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOGGER

        private static final java.util.logging.Logger LOGGER
    • Constructor Detail

      • BooleanTypeUtil

        private BooleanTypeUtil()
    • 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
      • fromCharacter

        private static boolean fromCharacter​(java.lang.Character charval)
                                      throws PSQLException
        Throws:
        PSQLException
      • cannotCoerceException

        private static PSQLException cannotCoerceException​(java.lang.Object value)