Package liquibase.database.structure.type

Examples of liquibase.database.structure.type.BooleanType


      return "null";
    }

    String returnValue;
    TypeConverter converter = TypeConverterFactory.getInstance().findTypeConverter(database);
    BooleanType booleanType = converter.getBooleanType();
    if (value instanceof String) {
      String trim = StringUtils.trim((String) value);
      if ("T".equals(trim)) {
        return booleanType.getTrueBooleanValue();
      } else if ("F".equals(trim) || StringUtils.isEmpty((String) value) || "0".equals(trim)) {
        return booleanType.getFalseBooleanValue();
      } else {
        throw new UnexpectedLiquibaseException("Unknown boolean value: " + value);
      }
    } else if (value instanceof Integer) {
      if (Integer.valueOf(1).equals(value)) {
        returnValue = booleanType.getTrueBooleanValue();
      } else {
        returnValue = booleanType.getFalseBooleanValue();
      }
    } else if (value instanceof Long) {
      if (Long.valueOf(1).equals(value)) {
        returnValue = booleanType.getTrueBooleanValue();
      } else {
        returnValue = booleanType.getFalseBooleanValue();
      }
    } else if (((Boolean) value)) {
      returnValue = booleanType.getTrueBooleanValue();
    } else {
      returnValue = booleanType.getFalseBooleanValue();
    }

    return returnValue;
  }
View Full Code Here

TOP

Related Classes of liquibase.database.structure.type.BooleanType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.