private static boolean isBoolean(ColumnType columnType, Object operand) { if (columnType == null) { return operand instanceof Boolean; } return columnType.isBoolean(); }
@Override public ColumnType getExpectedColumnType(ColumnType type) { if (type.isBoolean()) { return type; } return ColumnType.BOOLEAN; }
@Override public ColumnType getExpectedColumnType(ColumnType type) { if (type.isBoolean()) { return type; } return ColumnType.BOOLEAN; }
private static boolean isBoolean(ColumnType columnType, Object operand) { if (columnType == null) { return operand instanceof Boolean; } return columnType.isBoolean(); }
@Override public boolean isBoolean() { return _delegate.isBoolean(); }
@Override public boolean isBoolean() { return _delegate.isBoolean(); }
final String result = FileHelper.readAsString(reader); return result; } else if (type.isBoolean()) { return resultSet.getBoolean(columnIndex);
final String result = FileHelper.readAsString(reader); return result; } else if (type.isBoolean()) { return resultSet.getBoolean(columnIndex);
private Object convert(Object value, ColumnType columnType) { if (value instanceof String && !columnType.isLiteral()) { if (columnType.isBoolean()) { return BooleanComparator.toBoolean(value);
private Object convert(Object value, ColumnType columnType) { if (value instanceof String && !columnType.isLiteral()) { if (columnType.isBoolean()) { return BooleanComparator.toBoolean(value);
} else if (expectedColumnType.isBoolean()) { result = BooleanComparator.toBoolean(token); } else if (expectedColumnType.isTimeBased()) {
/** * Gets the size (in bytes) of a column with a specific {@link ColumnType} * and size */ private int getSize(ColumnType type, int columnSize) { final int baseSize; if (type.isBinary()) { baseSize = 1; } else if (type.isBoolean()) { baseSize = 1; } else if (type.isLiteral()) { baseSize = 2; } else if (type.isNumber()) { baseSize = 16; } else { baseSize = DEFAULT_COLUMN_SIZE; } int result = baseSize * columnSize; if (type.isLargeObject()) { // assign at least 4KB for LOBs. result = Math.max(result, 4 * KB); } return result; }
} else if (expectedColumnType.isBoolean()) { result = BooleanComparator.toBoolean(token); } else if (expectedColumnType.isTimeBased()) {
/** * Gets the size (in bytes) of a column with a specific {@link ColumnType} * and size */ private int getSize(ColumnType type, int columnSize) { final int baseSize; if (type.isBinary()) { baseSize = 1; } else if (type.isBoolean()) { baseSize = 1; } else if (type.isLiteral()) { baseSize = 2; } else if (type.isNumber()) { baseSize = 16; } else { baseSize = DEFAULT_COLUMN_SIZE; } int result = baseSize * columnSize; if (type.isLargeObject()) { // assign at least 4KB for LOBs. result = Math.max(result, 4 * KB); } return result; }
private Object convert(final String value, final ColumnType type) { if (value == null) { return null; } if (type == null) { return value; } final Object result; if (type.isNumber()) { result = NumberComparator.toNumber(value); } else if (type.isBoolean()) { result = BooleanComparator.toBoolean(value); } else if (type.isTimeBased()) { result = TimeComparator.toDate(value); } else { result = value; } if (result == null) { throw new IllegalStateException("Failed to convert value '" + value + "' to type: " + type); } return result; }
/** * Gets the (approximate) size (in bytes) of a column with a specific * {@link ColumnType}. */ private int getSize(ColumnType type) { if (type.isBinary()) { return 4 * KB; } else if (type.isBoolean()) { return 2; } else if (type.isLargeObject()) { return 4 * KB; } else if (type.isLiteral()) { return KB; } else if (type.isNumber()) { return 16; } else { return DEFAULT_COLUMN_SIZE; } } }
/** * Gets the (approximate) size (in bytes) of a column with a specific * {@link ColumnType}. */ private int getSize(ColumnType type) { if (type.isBinary()) { return 4 * KB; } else if (type.isBoolean()) { return 2; } else if (type.isLargeObject()) { return 4 * KB; } else if (type.isLiteral()) { return KB; } else if (type.isNumber()) { return 16; } else { return DEFAULT_COLUMN_SIZE; } } }
private Object convert(final String value, final ColumnType type) { if (value == null) { return null; } if (type == null) { return value; } final Object result; if (type.isNumber()) { result = NumberComparator.toNumber(value); } else if (type.isBoolean()) { result = BooleanComparator.toBoolean(value); } else if (type.isTimeBased()) { result = TimeComparator.toDate(value); } else { result = value; } if (result == null) { throw new IllegalStateException("Failed to convert value '" + value + "' to type: " + type); } return result; }