class BooleanType extends LiquibaseDataType {

    @Override
    public DatabaseDataType toDatabaseDataType(Database database) {
        String originalDefinition = StringUtil.trimToEmpty(getRawDefinition());
        if ((database instanceof FirebirdDatabase)) {
            try {
                if (database.getDatabaseMajorVersion() <= 2) {
                    return new DatabaseDataType("SMALLINT");
                }
            } catch (DatabaseException e) {
                Scope.getCurrentScope().getLog(getClass()).fine("Error checking database major version, assuming version 3+: "+e.getMessage(), e);
            }
            return new DatabaseDataType("BOOLEAN");
        }

        if ((database instanceof Db2zDatabase)) {
            return new DatabaseDataType("SMALLINT");
        } else if (database instanceof MSSQLDatabase) {
            return new DatabaseDataType(database.escapeDataTypeName("bit"));
        } else if (database instanceof MySQLDatabase) {
            if (originalDefinition.toLowerCase(Locale.US).startsWith("bit")) {
                return new DatabaseDataType("BIT", getParameters());
            }
            return database instanceof MariaDBDatabase ? new DatabaseDataType("TINYINT(1)") : new DatabaseDataType("TINYINT");
        } else if (database instanceof OracleDatabase) {
            try {
                if (database.getDatabaseMajorVersion() >= OracleDatabase.ORACLE_23C_MAJOR_VERSION) {
                    return new DatabaseDataType("BOOLEAN");
                }
            } catch (DatabaseException e) {
                Scope.getCurrentScope().getLog(getClass()).fine("Error checking database major version, assuming version <23: "+e.getMessage(), e);
            }
            return new DatabaseDataType("NUMBER", 1);
        } else if ((database instanceof SybaseASADatabase) || (database instanceof SybaseDatabase)) {
            return new DatabaseDataType("BIT");
        } else if (database instanceof DerbyDatabase) {
            if (((DerbyDatabase) database).supportsBooleanDataType()) {
                return new DatabaseDataType("BOOLEAN");
            } else {
                return new DatabaseDataType("SMALLINT");
            }
        } else if (database instanceof DB2Database) {
			if (((DB2Database) database).supportsBooleanDataType())
				return new DatabaseDataType("BOOLEAN");
			else
				return new DatabaseDataType("SMALLINT");
        } else if (database instanceof HsqlDatabase) {
            return new DatabaseDataType("BOOLEAN");
        } else if (database instanceof PostgresDatabase) {
            if (originalDefinition.toLowerCase(Locale.US).startsWith("bit")) {
                return new DatabaseDataType("BIT", getParameters());
            }
        } else if (database instanceof H2Database && getParameters().length > 0) {
          return new DatabaseDataType("BOOLEAN");
      }


        return super.toDatabaseDataType(database);
    }

    @Override
    public String objectToSql(Object value, Database database) {
        if ((value == null) || "null".equals(value.toString().toLowerCase(Locale.US))) {
            return null;
        }

        String returnValue;
        if (value instanceof String) {
            value = ((String) value).replaceAll("'", "");
            if ("true".equals(((String) value).toLowerCase(Locale.US)) || "1".equals(value) || "b'1'".equals(((String) value).toLowerCase(Locale.US)) || "t".equals(((String) value).toLowerCase(Locale.US)) || ((String) value).toLowerCase(Locale.US).equals(this.getTrueBooleanValue(database).toLowerCase(Locale.US))) {
                returnValue = this.getTrueBooleanValue(database);
            } else if ("false".equals(((String) value).toLowerCase(Locale.US)) || "0".equals(value) || "b'0'".equals(
                    ((String) value).toLowerCase(Locale.US)) || "f".equals(((String) value).toLowerCase(Locale.US)) || ((String) value).toLowerCase(Locale.US).equals(this.getFalseBooleanValue(database).toLowerCase(Locale.US))) {
                returnValue = this.getFalseBooleanValue(database);
            } else if (database instanceof PostgresDatabase && Pattern.matches("b?([01])\\1*(::bit|::\"bit\")?", (String) value)) {
                returnValue = "b'" 
                        + value.toString()
                                .replace("b", "")
                                .replace("\"", "")
                                .replace("::it", "")
                        + "'::\"bit\"";
            } else if (database instanceof SybaseASADatabase && ((String) value).startsWith("COMPUTE")) {
                returnValue = (String) value;
            } else {
                throw new UnexpectedLiquibaseException("Unknown boolean value: " + value);
            }
        } else if (value instanceof Long) {
            if (Long.valueOf(1).equals(value)) {
                returnValue = this.getTrueBooleanValue(database);
            } else {
                returnValue = this.getFalseBooleanValue(database);
            }
        } else if (value instanceof Number) {
            if (value.equals(1) || "1".equals(value.toString()) || "1.0".equals(value.toString())) {
                returnValue = this.getTrueBooleanValue(database);
            } else {
                returnValue = this.getFalseBooleanValue(database);
            }
        } else if (value instanceof DatabaseFunction) {
            return value.toString();
        } else if (value instanceof Boolean) {
            if (((Boolean) value)) {
                returnValue = this.getTrueBooleanValue(database);
            } else {
                returnValue = this.getFalseBooleanValue(database);
            }
        } else {
            throw new UnexpectedLiquibaseException("Cannot convert type "+value.getClass()+" to a boolean value");
        }

        return returnValue;
    }

    protected boolean isNumericBoolean(Database database) {
        if ((database instanceof FirebirdDatabase)) {
            try {
                if (database.getDatabaseMajorVersion() <= 2) {
                    return true;
                }
            } catch (DatabaseException e) {
                Scope.getCurrentScope().getLog(getClass()).fine("Error checking database major version, assuming version 3+: "+e.getMessage(), e);
            }
            return false;
        }
        if (database instanceof DerbyDatabase) {
            return !((DerbyDatabase) database).supportsBooleanDataType();
        } else if (database instanceof DB2Database) {
			return !((DB2Database) database).supportsBooleanDataType();
    	}
        return (database instanceof Db2zDatabase) || (database instanceof FirebirdDatabase) || (database instanceof
            MSSQLDatabase) || (database instanceof MySQLDatabase) || (database instanceof OracleDatabase) ||
            (database instanceof SQLiteDatabase) || (database instanceof SybaseASADatabase) || (database instanceof
            SybaseDatabase);
    }

    /**
     * The database-specific value to use for "false" "boolean" columns.
     */
    public String getFalseBooleanValue(Database database) {<FILL_FUNCTION_BODY>}

    /**
     * The database-specific value to use for "true" "boolean" columns.
     */
    public String getTrueBooleanValue(Database database) {
        if (isNumericBoolean(database)) {
            return "1";
        }
        if (database instanceof InformixDatabase) {
            return "'t'";
        }
        return "TRUE";
    }

    @Override
    public LoadDataChange.LOAD_DATA_TYPE getLoadTypeName() {
        return LoadDataChange.LOAD_DATA_TYPE.BOOLEAN;
    }

}

        if (isNumericBoolean(database)) {
            return "0";
        }
        if (database instanceof InformixDatabase) {
            return "'f'";
        }
        return "FALSE";
    
<methods>public void <init>() ,public void addParameter(java.lang.Object) ,public boolean equals(java.lang.Object) ,public void finishInitialization(java.lang.String) ,public java.lang.String getAdditionalInformation() ,public java.lang.String[] getAliases() ,public abstract liquibase.change.core.LoadDataChange.LOAD_DATA_TYPE getLoadTypeName() ,public int getMaxParameters(liquibase.database.Database) ,public int getMinParameters(liquibase.database.Database) ,public java.lang.String getName() ,public java.lang.Object[] getParameters() ,public int getPriority() ,public java.lang.String getRawDefinition() ,public int hashCode() ,public boolean isAutoIncrement() ,public java.lang.String objectToSql(java.lang.Object, liquibase.database.Database) ,public void setAdditionalInformation(java.lang.String) ,public java.lang.Object sqlToObject(java.lang.String, liquibase.database.Database) ,public boolean supports(liquibase.database.Database) ,public liquibase.datatype.DatabaseDataType toDatabaseDataType(liquibase.database.Database) ,public java.lang.String toString() ,public boolean validate(liquibase.database.Database) <variables>private java.lang.String additionalInformation,private final non-sealed java.lang.String[] aliases,private final non-sealed int maxParameters,private final non-sealed int minParameters,private final non-sealed java.lang.String name,private final List<java.lang.Object> parameters,private final non-sealed int priority,private java.lang.String rawDefinition