@FunctionalInterface public interface IGetterByIndexTrait
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
s_aTraitLogger |
| Modifier and Type | Method and Description |
|---|---|
default BigDecimal |
getAsBigDecimal(int nIndex) |
default BigDecimal |
getAsBigDecimal(int nIndex,
BigDecimal aDefault) |
default BigInteger |
getAsBigInteger(int nIndex) |
default BigInteger |
getAsBigInteger(int nIndex,
BigInteger aDefault) |
default boolean |
getAsBoolean(int nIndex) |
default boolean |
getAsBoolean(int nIndex,
boolean bDefault) |
default Boolean |
getAsBooleanObj(int nIndex) |
default byte |
getAsByte(int nIndex) |
default byte |
getAsByte(int nIndex,
byte nDefault) |
default byte[] |
getAsByteArray(int nIndex) |
default Byte |
getAsByteObj(int nIndex) |
default char |
getAsChar(int nIndex) |
default char |
getAsChar(int nIndex,
char cDefault) |
default char[] |
getAsCharArray(int nIndex) |
default char[] |
getAsCharArray(int nIndex,
char[] aDefault) |
default Character |
getAsCharObj(int nIndex) |
default double |
getAsDouble(int nIndex) |
default double |
getAsDouble(int nIndex,
double dDefault) |
default Double |
getAsDoubleObj(int nIndex) |
default float |
getAsFloat(int nIndex) |
default float |
getAsFloat(int nIndex,
float fDefault) |
default Float |
getAsFloatObj(int nIndex) |
default int |
getAsInt(int nIndex) |
default int |
getAsInt(int nIndex,
int nDefault) |
default Integer |
getAsIntObj(int nIndex) |
default LocalDate |
getAsLocalDate(int nIndex) |
default LocalDate |
getAsLocalDate(int nIndex,
LocalDate aDefault) |
default LocalDate |
getAsLocalDate(int nIndex,
Locale aContentLocale)
Get the value as a String, interpreted as a
LocalDate. |
default LocalDateTime |
getAsLocalDateTime(int nIndex) |
default LocalDateTime |
getAsLocalDateTime(int nIndex,
LocalDateTime aDefault) |
default LocalDateTime |
getAsLocalDateTime(int nIndex,
Locale aContentLocale)
Get the value as a String, interpreted as a
LocalDateTime. |
default LocalTime |
getAsLocalTime(int nIndex) |
default LocalTime |
getAsLocalTime(int nIndex,
Locale aContentLocale)
Get the value as a String, interpreted as a
LocalTime. |
default LocalTime |
getAsLocalTime(int nIndex,
LocalTime aDefault) |
default long |
getAsLong(int nIndex) |
default long |
getAsLong(int nIndex,
long nDefault) |
default Long |
getAsLongObj(int nIndex) |
default short |
getAsShort(int nIndex) |
default short |
getAsShort(int nIndex,
short nDefault) |
default Short |
getAsShortObj(int nIndex) |
default Blob |
getAsSqlBlob(int nIndex) |
default Clob |
getAsSqlClob(int nIndex) |
default Date |
getAsSqlDate(int nIndex) |
default NClob |
getAsSqlNClob(int nIndex) |
default RowId |
getAsSqlRowId(int nIndex) |
default Time |
getAsSqlTime(int nIndex) |
default Timestamp |
getAsSqlTimestamp(int nIndex) |
default String |
getAsString(int nIndex) |
default String |
getAsString(int nIndex,
String sDefault) |
default ICommonsList<String> |
getAsStringList(int nIndex)
Get a list of all attribute values with the same name.
|
default ICommonsList<String> |
getAsStringList(int nIndex,
ICommonsList<String> aDefault)
Get a list of all attribute values with the same name.
|
default ICommonsOrderedSet<String> |
getAsStringSet(int nIndex)
Get a set of all attribute values with the same name.
|
default ICommonsOrderedSet<String> |
getAsStringSet(int nIndex,
ICommonsOrderedSet<String> aDefault)
Get a set of all attribute values with the same name.
|
default <T> T |
getCastedValue(int nIndex)
Get the contained value casted to the return type.
|
default <T> T |
getCastedValue(int nIndex,
Class<T> aClass)
Get the contained value casted to the specified class.
|
default <T> T |
getCastedValue(int nIndex,
T aDefault)
Get the contained value casted to the return type.
|
default <T> T |
getCastedValue(int nIndex,
T aDefault,
Class<T> aClass)
Get the contained value casted to the specified class.
|
default <T> T |
getConvertedValue(int nIndex,
Class<T> aClass)
Get the contained value converted using TypeConverter to the passed class.
|
default <T> T |
getConvertedValue(int nIndex,
T aDefault,
Class<T> aClass)
Get the contained value converted using TypeConverter to the passed class.
|
default <T> T |
getSafeCastedValue(int nIndex,
Class<T> aClass)
Get the contained value casted to the specified class, but only if the cast
is possible.
|
default <T> T |
getSafeCastedValue(int nIndex,
T aDefault,
Class<T> aClass)
Get the contained value casted to the specified class, but only if the cast
is possible.
|
Object |
getValue(int nIndex)
Get the value at the specified index.
|
default Class<?> |
getValueClass(int nIndex) |
default boolean |
hasNoValue(int nIndex) |
default boolean |
hasStringValue(int nIndex,
String sDesiredValue)
Check if a attribute with the given name is present in the request and has
the specified value.
|
default boolean |
hasStringValue(int nIndex,
String sDesiredValue,
boolean bDefault)
Check if a attribute with the given name is present in the request and has
the specified value.
|
default boolean |
hasValue(int nIndex) |
@Nullable Object getValue(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.null constraints
applicable.@Nullable default Class<?> getValueClass(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.null if no value is
contained.default boolean hasValue(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.true if the value is not null. Same as
getValue()!=null.default boolean hasNoValue(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.true if the value is null. Same as
getValue()==null.@Nullable default <T> T getCastedValue(@Nonnegative int nIndex) throws ClassCastException
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getCastedValue(@Nonnegative int nIndex, @Nullable T aDefault) throws ClassCastException
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getCastedValue(@Nonnegative int nIndex, @Nonnull Class<T> aClass) throws ClassCastException
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aClass - The class to cast to.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getCastedValue(@Nonnegative int nIndex, @Nullable T aDefault, @Nonnull Class<T> aClass) throws ClassCastException
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.aClass - The class to cast to.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getSafeCastedValue(@Nonnegative int nIndex, @Nonnull Class<T> aClass)
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aClass - The class to cast to.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getSafeCastedValue(@Nonnegative int nIndex, @Nullable T aDefault, @Nonnull Class<T> aClass)
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.aClass - The class to cast to.null if the contained value is null.ClassCastException - in case the value types are not convertible@Nullable default <T> T getConvertedValue(@Nonnegative int nIndex, @Nonnull Class<T> aClass)
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aClass - The class to convert to.null if the contained value is null.TypeConverterException - in case of an error@Nullable default <T> T getConvertedValue(@Nonnegative int nIndex, @Nullable T aDefault, @Nonnull Class<T> aClass)
T - Destination typenIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.aClass - The class to convert to.null if the contained value is null.TypeConverterException - in case of an errordefault boolean getAsBoolean(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault boolean getAsBoolean(@Nonnegative int nIndex, boolean bDefault)
default byte getAsByte(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault byte getAsByte(@Nonnegative int nIndex, byte nDefault)
default char getAsChar(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault char getAsChar(@Nonnegative int nIndex, char cDefault)
default double getAsDouble(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault double getAsDouble(@Nonnegative int nIndex, double dDefault)
default float getAsFloat(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault float getAsFloat(@Nonnegative int nIndex, float fDefault)
default int getAsInt(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault int getAsInt(@Nonnegative int nIndex, int nDefault)
default long getAsLong(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault long getAsLong(@Nonnegative int nIndex, long nDefault)
default short getAsShort(@Nonnegative int nIndex) throws TypeConverterException
TypeConverterExceptiondefault short getAsShort(@Nonnegative int nIndex, short nDefault)
@Nullable default String getAsString(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,String.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default String getAsString(@Nonnegative int nIndex, @Nullable String sDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.sDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,sDefault, String.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default char[] getAsCharArray(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,char[].class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default char[] getAsCharArray(@Nonnegative int nIndex, @Nullable char[] aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault, char[].class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default BigDecimal getAsBigDecimal(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,BigDecimal.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default BigDecimal getAsBigDecimal(@Nonnegative int nIndex, @Nullable BigDecimal aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault,BigDecimal.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default BigInteger getAsBigInteger(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,BigInteger.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default BigInteger getAsBigInteger(@Nonnegative int nIndex, @Nullable BigInteger aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault,BigInteger.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default LocalDate getAsLocalDate(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,LocalDate.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default LocalDate getAsLocalDate(@Nonnegative int nIndex, @Nullable LocalDate aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault,LocalDate.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default LocalTime getAsLocalTime(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,LocalTime.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default LocalTime getAsLocalTime(@Nonnegative int nIndex, @Nullable LocalTime aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault,LocalTime.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default LocalDateTime getAsLocalDateTime(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,LocalDateTime.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default LocalDateTime getAsLocalDateTime(@Nonnegative int nIndex, @Nullable LocalDateTime aDefault) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The value to be returned if the retrieved value is null
.getConvertedValue (nIndex,aDefault,LocalDateTime.class)TypeConverterException - in case of an errorgetConvertedValue(int,Object,Class)@Nullable default byte[] getAsByteArray(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,byte[].class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Boolean getAsBooleanObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Boolean.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Byte getAsByteObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Byte.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Character getAsCharObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Character.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Double getAsDoubleObj(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Double.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Float getAsFloatObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Float.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Integer getAsIntObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Integer.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Long getAsLongObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Long.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Short getAsShortObj(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Short.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Blob getAsSqlBlob(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Blob.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Clob getAsSqlClob(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Clob.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Date getAsSqlDate(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Date.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default NClob getAsSqlNClob(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,NClob.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default RowId getAsSqlRowId(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,RowId.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Time getAsSqlTime(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Time.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default Timestamp getAsSqlTimestamp(@Nonnegative int nIndex) throws TypeConverterException
nIndex - The index to be accessed. Should be ≥ 0.getConvertedValue (nIndex,Timestamp.class)TypeConverterException - in case of an errorgetConvertedValue(int,Class)@Nullable default LocalDate getAsLocalDate(@Nonnegative int nIndex, @Nonnull Locale aContentLocale)
LocalDate.nIndex - The index to be accessed. Should be ≥ 0.aContentLocale - Locale to use for conversion.null if either the conversion to String or the parsing
of the String failed.@Nullable default LocalTime getAsLocalTime(@Nonnegative int nIndex, @Nonnull Locale aContentLocale)
LocalTime.nIndex - The index to be accessed. Should be ≥ 0.aContentLocale - Locale to use for conversion.null if either the conversion to String or the parsing
of the String failed.@Nullable default LocalDateTime getAsLocalDateTime(@Nonnegative int nIndex, @Nonnull Locale aContentLocale)
LocalDateTime.nIndex - The index to be accessed. Should be ≥ 0.aContentLocale - Locale to use for conversion.null if either the conversion to String or the parsing
of the String failed.@Nullable default ICommonsList<String> getAsStringList(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.null if no such attribute value exists@Nullable default ICommonsList<String> getAsStringList(@Nonnegative int nIndex, @Nullable ICommonsList<String> aDefault)
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The default value to be returned, if no such attribute is present.aDefault if no such attribute value exists@Nullable default ICommonsOrderedSet<String> getAsStringSet(@Nonnegative int nIndex)
nIndex - The index to be accessed. Should be ≥ 0.null if no such attribute value exists@Nullable default ICommonsOrderedSet<String> getAsStringSet(@Nonnegative int nIndex, @Nullable ICommonsOrderedSet<String> aDefault)
nIndex - The index to be accessed. Should be ≥ 0.aDefault - The default value to be returned, if no such attribute is present.aDefault if no such attribute value existsdefault boolean hasStringValue(@Nonnegative int nIndex, @Nullable String sDesiredValue)
nIndex - The index to be accessed. Should be ≥ 0.sDesiredValue - The value to be matchedtrue if an attribute with the given name is present
and has the desired valuedefault boolean hasStringValue(@Nonnegative int nIndex, @Nullable String sDesiredValue, boolean bDefault)
nIndex - The index to be accessed. Should be ≥ 0.sDesiredValue - The value to be matchedbDefault - the default value to be returned, if the specified attribute is not
presenttrue if an attribute with the given name is present
and has the desired value, false if the attribute is
present but has a different value. If the attribute is not present,
the default value is returned.Copyright © 2014–2017 Philip Helger. All rights reserved.