[#1887] Remove all deprecated code - Removed getValueAs[...] methods

This commit is contained in:
Lukas Eder 2012-10-27 20:39:00 +02:00
parent 3a94ca1a6c
commit 31d145ea52
2 changed files with 0 additions and 542 deletions

View File

@ -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<E> 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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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.
* <p>
* boolean values for <code>true</code> are any of these case-insensitive
* strings:
* <ul>
* <li><code>1</code></li>
* <li><code>y</code></li>
* <li><code>yes</code></li>
* <li><code>true</code></li>
* <li><code>on</code></li>
* <li><code>enabled</code></li>
* </ul>
* <p>
* boolean values for <code>false</code> are any of these case-insensitive
* strings:
* <ul>
* <li><code>0</code></li>
* <li><code>n</code></li>
* <li><code>no</code></li>
* <li><code>false</code></li>
* <li><code>off</code></li>
* <li><code>disabled</code></li>
* </ul>
* <p>
* All other values evaluate to <code>null</code>
*
* @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.
* <p>
* boolean values for <code>true</code> are any of these case-insensitive
* strings:
* <ul>
* <li><code>1</code></li>
* <li><code>y</code></li>
* <li><code>yes</code></li>
* <li><code>true</code></li>
* <li><code>on</code></li>
* <li><code>enabled</code></li>
* </ul>
* <p>
* boolean values for <code>false</code> are any of these case-insensitive
* strings:
* <ul>
* <li><code>0</code></li>
* <li><code>n</code></li>
* <li><code>no</code></li>
* <li><code>false</code></li>
* <li><code>off</code></li>
* <li><code>disabled</code></li>
* </ul>
* <p>
* All other values evaluate to <code>null</code>
*
* @param index The field's index
* @param defaultValue The default value instead of <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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 <code>null</code>
* @return The converted value of a field's index contained in this Store,
* or defaultValue, if <code>null</code>
* @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.
*

View File

@ -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<T> implements Store<T>, 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> Z getValue(int index, Class<? extends Z> type) {
return Convert.convert(getValue(index), type);