From 31d145ea52750ab54c2792bf68ef799afbaee212 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 27 Oct 2012 20:39:00 +0200 Subject: [PATCH] [#1887] Remove all deprecated code - Removed getValueAs[...] methods --- jOOQ/src/main/java/org/jooq/Store.java | 394 ------------------ .../java/org/jooq/impl/AbstractStore.java | 148 ------- 2 files changed, 542 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/Store.java b/jOOQ/src/main/java/org/jooq/Store.java index 322479ce35..91159f0cfe 100644 --- a/jOOQ/src/main/java/org/jooq/Store.java +++ b/jOOQ/src/main/java/org/jooq/Store.java @@ -35,12 +35,6 @@ */ package org.jooq; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; - import org.jooq.exception.DataTypeException; import org.jooq.tools.Convert; @@ -94,394 +88,6 @@ public interface Store extends Attachable { */ E getValue(int index, E defaultValue) throws IllegalArgumentException; - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - BigDecimal getValueAsBigDecimal(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - BigDecimal getValueAsBigDecimal(int index, BigDecimal defaultValue) throws IllegalArgumentException, - DataTypeException; - - /** - * Get a value from this Store, providing a field index. - *

- * boolean values for true are any of these case-insensitive - * strings: - *

- *

- * boolean values for false are any of these case-insensitive - * strings: - *

- *

- * All other values evaluate to null - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Boolean getValueAsBoolean(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - *

- * boolean values for true are any of these case-insensitive - * strings: - *

- *

- * boolean values for false are any of these case-insensitive - * strings: - *

- *

- * All other values evaluate to null - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Boolean getValueAsBoolean(int index, Boolean defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - BigInteger getValueAsBigInteger(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - BigInteger getValueAsBigInteger(int index, BigInteger defaultValue) throws IllegalArgumentException, - DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Byte getValueAsByte(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Byte getValueAsByte(int index, Byte defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Date getValueAsDate(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Date getValueAsDate(int index, Date defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Double getValueAsDouble(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Double getValueAsDouble(int index, Double defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Float getValueAsFloat(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Float getValueAsFloat(int index, Float defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Integer getValueAsInteger(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Integer getValueAsInteger(int index, Integer defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Long getValueAsLong(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Long getValueAsLong(int index, Long defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Short getValueAsShort(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Short getValueAsShort(int index, Short defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - String getValueAsString(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - String getValueAsString(int index, String defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Time getValueAsTime(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Time getValueAsTime(int index, Time defaultValue) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @return The converted value of a field's index contained in this Store - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Timestamp getValueAsTimestamp(int index) throws IllegalArgumentException, DataTypeException; - - /** - * Get a value from this Store, providing a field index. - * - * @param index The field's index - * @param defaultValue The default value instead of null - * @return The converted value of a field's index contained in this Store, - * or defaultValue, if null - * @throws IllegalArgumentException If the argument index is not contained - * in the Store - * @throws DataTypeException wrapping data type conversion exception that - * might have occurred - */ - Timestamp getValueAsTimestamp(int index, Timestamp defaultValue) throws IllegalArgumentException, DataTypeException; - /** * Get a converted value from this Store, providing a field index. * diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractStore.java b/jOOQ/src/main/java/org/jooq/impl/AbstractStore.java index f5021903e2..85641a0c79 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractStore.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractStore.java @@ -35,11 +35,6 @@ */ package org.jooq.impl; -import java.math.BigDecimal; -import java.math.BigInteger; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; import java.util.Arrays; import org.jooq.Attachable; @@ -104,149 +99,6 @@ abstract class AbstractStore implements Store, AttachableInternal { return result == null ? defaultValue : result; } - @Override - public final BigDecimal getValueAsBigDecimal(int index) { - return Convert.convert(getValue(index), BigDecimal.class); - } - - @Override - public final BigDecimal getValueAsBigDecimal(int index, BigDecimal defaultValue) { - final BigDecimal result = getValueAsBigDecimal(index); - return result == null ? defaultValue : result; - } - - @Override - public final Boolean getValueAsBoolean(int index) { - return Convert.convert(getValue(index), Boolean.class); - } - - @Override - public final Boolean getValueAsBoolean(int index, Boolean defaultValue) { - final Boolean result = getValueAsBoolean(index); - return result == null ? defaultValue : result; - } - - @Override - public final BigInteger getValueAsBigInteger(int index) { - return Convert.convert(getValue(index), BigInteger.class); - } - - @Override - public final BigInteger getValueAsBigInteger(int index, BigInteger defaultValue) { - final BigInteger result = getValueAsBigInteger(index); - return result == null ? defaultValue : result; - } - - @Override - public final Byte getValueAsByte(int index) { - return Convert.convert(getValue(index), Byte.class); - } - - @Override - public final Byte getValueAsByte(int index, Byte defaultValue) { - final Byte result = getValueAsByte(index); - return result == null ? defaultValue : result; - } - - @Override - public final Date getValueAsDate(int index) { - return Convert.convert(getValue(index), Date.class); - } - - @Override - public final Date getValueAsDate(int index, Date defaultValue) { - final Date result = getValueAsDate(index); - return result == null ? defaultValue : result; - } - - @Override - public final Double getValueAsDouble(int index) { - return Convert.convert(getValue(index), Double.class); - } - - @Override - public final Double getValueAsDouble(int index, Double defaultValue) { - final Double result = getValueAsDouble(index); - return result == null ? defaultValue : result; - } - - @Override - public final Float getValueAsFloat(int index) { - return Convert.convert(getValue(index), Float.class); - } - - @Override - public final Float getValueAsFloat(int index, Float defaultValue) { - final Float result = getValueAsFloat(index); - return result == null ? defaultValue : result; - } - - @Override - public final Integer getValueAsInteger(int index) { - return Convert.convert(getValue(index), Integer.class); - } - - @Override - public final Integer getValueAsInteger(int index, Integer defaultValue) { - final Integer result = getValueAsInteger(index); - return result == null ? defaultValue : result; - } - - @Override - public final Long getValueAsLong(int index) { - return Convert.convert(getValue(index), Long.class); - } - - @Override - public final Long getValueAsLong(int index, Long defaultValue) { - final Long result = getValueAsLong(index); - return result == null ? defaultValue : result; - } - - @Override - public final Short getValueAsShort(int index) { - return Convert.convert(getValue(index), Short.class); - } - - @Override - public final Short getValueAsShort(int index, Short defaultValue) { - final Short result = getValueAsShort(index); - return result == null ? defaultValue : result; - } - - @Override - public final String getValueAsString(int index) { - return Convert.convert(getValue(index), String.class); - } - - @Override - public final String getValueAsString(int index, String defaultValue) { - final String result = getValueAsString(index); - return result == null ? defaultValue : result; - } - - @Override - public final Time getValueAsTime(int index) { - return Convert.convert(getValue(index), Time.class); - } - - @Override - public final Time getValueAsTime(int index, Time defaultValue) { - final Time result = getValueAsTime(index); - return result == null ? defaultValue : result; - } - - @Override - public final Timestamp getValueAsTimestamp(int index) { - return Convert.convert(getValue(index), Timestamp.class); - } - - @Override - public final Timestamp getValueAsTimestamp(int index, Timestamp defaultValue) { - final Timestamp result = getValueAsTimestamp(index); - return result == null ? defaultValue : result; - } - @Override public final Z getValue(int index, Class type) { return Convert.convert(getValue(index), type);