Code example for Scanner

Methods: hasNextBigIntegerhasNextBooleannextBigIntegernextBoolean

0
            stringVal = stringVal.substring(2, stringVal.length() - 2);
        } else if (stringVal.startsWith("(") && stringVal.endsWith(")")) {
            return new DatabaseFunction(stringVal.substring(1, stringVal.length() - 1));
        } 
 
        Scanner scanner = new Scanner(stringVal.trim());
        if (typeId == Types.ARRAY) {
            return new DatabaseFunction(stringVal);
        } else if ((liquibaseDataType instanceof BigIntType || typeId == Types.BIGINT)) {
            if (scanner.hasNextBigInteger()) {
                return scanner.nextBigInteger();
            } else { 
                return new DatabaseFunction(stringVal);
            } 
        } else if (typeId == Types.BINARY) {
            return new DatabaseFunction(stringVal.trim());
        } else if (typeId == Types.BIT) {
            if (stringVal.startsWith("b'")) { //mysql returns boolean values as b'0' and b'1'
                stringVal = stringVal.replaceFirst("b'", "").replaceFirst("'$", "");
            } 
            stringVal = stringVal.trim();
            if (scanner.hasNextBoolean()) {
                return scanner.nextBoolean();
            } else { 
                return new Integer(stringVal);
            } 
        } else if (liquibaseDataType instanceof BlobType|| typeId == Types.BLOB) {
            return new DatabaseFunction(stringVal);
        } else if ((liquibaseDataType instanceof BooleanType || typeId == Types.BOOLEAN )) {
            if (scanner.hasNextBoolean()) {
                return scanner.nextBoolean();
            } else { 
                return new DatabaseFunction(stringVal);
            } 
        } else if (liquibaseDataType instanceof CharType || typeId == Types.CHAR) {
            return stringVal;