Booleans in SQLite are handled as {@code int}s. Use this as a convenience to retrieve a
boolean from a column.
178889
public boolean getBoolean(String columnName, boolean defaultValue) {
        int defaultValueAsInt = (defaultValue) ? SQLITE_TRUE : SQLITE_FALSE;

        return getInteger(columnName, defaultValueAsInt) == SQLITE_TRUE;
    }
265734
@SuppressFBWarnings("NP_BOOLEAN_RETURN_NULL")
    public static Boolean getBoolean(final ResultSet rs, final int columnIndex) throws SQLException
    {
        final boolean res = rs.getBoolean(columnIndex);
        if (rs.wasNull()) {
            return null;
        } else {
            return res;
        }
    }
202865
public void add(@Nonnull  Boolean...booleans) {
        for (Boolean b : booleans) {
            add(primitive(b));
        }
    }
894639
@Override
  public void visit(Column column) {
    String stringValue = column.getColumnName();
    if (stringValue.equalsIgnoreCase("true") || stringValue.equalsIgnoreCase("false")) {
      setValue(Boolean.valueOf(stringValue), Types.BOOLEAN);
    }
  }
1320236
def _cast_boolean(value):
    
    _BOOLEANS = {'1': True, 'yes': True, 'true': True, 'on': True,
                 '0': False, 'no': False, 'false': False, 'off': False, '': False}
    value = str(value)
    if value.lower() not in _BOOLEANS:
        raise ValueError('Not a boolean: %s' % value)

    return _BOOLEANS[value.lower()]
265881
public boolean isAutoIncrement(int column) throws SQLException {
    fetchFieldMetaData();
    Field field = getField(column);
    FieldMetadata metadata = field.getMetadata();
    return metadata != null && metadata.autoIncrement;
  }
743137
public static int intForQuery(SQLiteConnection conn, String query, Object[] bindArgs) throws SQLiteException {
        SQLiteStatement stmt = null;
        try {
            stmt = bindArguments(conn.prepare(query), bindArgs);
            if (stmt.step()) {
                return stmt.columnInt(0);
            } else {
                throw new IllegalStateException("query failed to return any result: " + query);
            }
        } finally {
            SQLiteWrapperUtils.disposeQuietly(stmt);
        }
    }
428406
public static boolean getBoolean(Cursor cursor, String columnName) {
        return cursor != null && cursor.getInt(cursor.getColumnIndex(columnName)) == TRUE;
    }
173950
public static final Function<Integer,Boolean> isNull() {
        return (Function<Integer,Boolean>)((Function)FnObject.isNull());
    }
806589
protected int integer(String functionCall, String condition, Object... args) throws DAOException{
        if(condition==null)
            condition = "";

        return jdbc.selectFirst("SELECT "+functionCall+" FROM "+table.name+' '+condition, new RowMapper<Integer>(){
            @Override
            public Integer newRecord(ResultSet rs) throws SQLException{
                return rs.getInt(1);
            }
        }, args);
    }
44662
public Boolean getAsBoolean(String key) {
        Object value = mValues.get(key);
        try {
            return (Boolean) value;
        } catch (ClassCastException e) {
            if (value instanceof CharSequence) {
                return Boolean.valueOf(value.toString());
            } else if (value instanceof Number) {
                return ((Number) value).intValue() != 0;
            } else {
                DLog.e(TAG, "Cannot cast value for " + key + " to a Boolean: " + value, e);
                return null;
            }
        }
    }
1262990
private boolean isIntegerColumn(String columnName, List<String> tableNames, boolean debugPrint) {
        List<String> intColumnTypes = Arrays.asList("TINYINT", "SMALLINT", "INTEGER", "BIGINT");
        return isColumnType(intColumnTypes, columnName, tableNames, debugPrint);
    }
433534
static boolean readBoolean(Node node)
    {
        if (node == null)
        {
            throw new XmlException(
                "Tried to read boolean value from null node");
        }
        String value = node.getFirstChild().getNodeValue();
        return Boolean.parseBoolean(value);
    }
322635
private void checkColumn(int column) throws SQLException {

        if (column < 1 || column > columnCount) {
            throw Util.sqlException(ErrorCode.JDBC_COLUMN_NOT_FOUND,
                                    String.valueOf(column));
        }
    }
637734
private boolean isInt(String str) {
        try {
            Integer.parseInt(str);
        } catch (NumberFormatException e) {
            return false;
        }
        return true;
    }
1263219
public final void boolean_key() throws RecognitionException {
		Token id=null;

		try {
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:760:5: ({...}? =>id= ID )
			// src/main/resources/org/drools/compiler/lang/DRL6Expressions.g:760:12: {...}? =>id= ID
			{
			if ( !(((helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN)))) ) {
				if (state.backtracking>0) {state.failed=true; return;}
				throw new FailedPredicateException(input, "boolean_key", "(helper.validateIdentifierKey(DroolsSoftKeywords.BOOLEAN))");
			}
			id=(Token)match(input,ID,FOLLOW_ID_in_boolean_key4824); if (state.failed) return;
			if ( state.backtracking==0 ) { helper.emit(id, DroolsEditorType.KEYWORD); }
			}

		}

		catch (RecognitionException re) {
		    throw re;
		}

		finally {
			// do for sure before leaving
		}
	}
201629
public boolean getBoolean(int key) {
        Any3<Boolean, Integer, String> value = data.get(Any2.<Integer, String>left(key));
        if (value == null)
            throw new IllegalArgumentException("missing argument for param " + key);
        return value.get1().orElseThrow(() -> new IllegalArgumentException("expected boolean argument for param " + key));
    }