KEYTYPE - Key typeVALUETYPE - Value type@NotThreadSafe public abstract class AbstractReadOnlyAttributeContainer<KEYTYPE,VALUETYPE> extends Object implements IAttributeContainer<KEYTYPE,VALUETYPE>
| Constructor and Description |
|---|
AbstractReadOnlyAttributeContainer() |
| Modifier and Type | Method and Description |
|---|---|
static BigDecimal |
getAsBigDecimal(Object aParamName,
Object aValue,
BigDecimal aDefault) |
static BigInteger |
getAsBigInteger(Object aParamName,
Object aValue,
BigInteger aDefault) |
static boolean |
getAsBoolean(Object aParamName,
Object aValue,
boolean bDefault) |
static double |
getAsDouble(Object aParamName,
Object aValue,
double dDefault) |
static int |
getAsInt(Object aParamName,
Object aValue,
int nDefault) |
static long |
getAsLong(Object aParamName,
Object aValue,
long nDefault) |
static String |
getAsString(Object aParamName,
Object aValue,
String sDefault)
Get the string representation of the passed value, suitable for parameters.
|
BigDecimal |
getAttributeAsBigDecimal(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
BigDecimal |
getAttributeAsBigDecimal(KEYTYPE aName,
BigDecimal aDefault)
Get the attribute value associated to the given attribute name.
|
BigInteger |
getAttributeAsBigInteger(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
BigInteger |
getAttributeAsBigInteger(KEYTYPE aName,
BigInteger aDefault)
Get the attribute value associated to the given attribute name.
|
boolean |
getAttributeAsBoolean(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
boolean |
getAttributeAsBoolean(KEYTYPE aName,
boolean bDefault)
Get the attribute value associated to the given attribute name.
|
double |
getAttributeAsDouble(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
double |
getAttributeAsDouble(KEYTYPE aName,
double dDefault)
Get the attribute value associated to the given attribute name.
|
int |
getAttributeAsInt(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
int |
getAttributeAsInt(KEYTYPE aName,
int nDefault)
Get the attribute value associated to the given attribute name.
|
long |
getAttributeAsLong(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
long |
getAttributeAsLong(KEYTYPE aName,
long nDefault)
Get the attribute value associated to the given attribute name.
|
String |
getAttributeAsString(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
String |
getAttributeAsString(KEYTYPE aName,
String sDefault)
Get the attribute value associated to the given attribute name or the
passed default value if no such attribute is present.
|
<DATATYPE> DATATYPE |
getCastedAttribute(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getCastedAttribute(KEYTYPE aName,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getTypedAttribute(KEYTYPE aName,
Class<DATATYPE> aDstClass)
Get the attribute value associated to the given attribute name.
|
<DATATYPE> DATATYPE |
getTypedAttribute(KEYTYPE aName,
Class<DATATYPE> aDstClass,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontainsAttribute, containsNoAttribute, getAllAttributeNames, getAllAttributes, getAllAttributeValues, getAttributeCount, getAttributeObject@Nullable public final <DATATYPE> DATATYPE getCastedAttribute(@Nullable KEYTYPE aName)
IAttributeContainerClassCastException is thrown! If you just want to
retrieve a String, use IAttributeContainer.getAttributeAsString(Object)!getCastedAttribute(aName, null)getCastedAttribute in interface IAttributeContainer<KEYTYPE,VALUETYPE>DATATYPE - return typeaName - the attribute namenull if no such value exists@Nullable public final <DATATYPE> DATATYPE getCastedAttribute(@Nullable KEYTYPE aName, @Nullable DATATYPE aDefault)
IAttributeContainerClassCastException is thrown! If you just want to
retrieve a String, use IAttributeContainer.getAttributeAsString(Object, String)!getCastedAttribute in interface IAttributeContainer<KEYTYPE,VALUETYPE>DATATYPE - return typeaName - The attribute name.aDefault - The default value to be returned if no such attribute exists@Nullable public final <DATATYPE> DATATYPE getTypedAttribute(@Nullable KEYTYPE aName, @Nonnull Class<DATATYPE> aDstClass)
IAttributeContainerIAttributeContainer.getAttributeAsString(Object)!getTypedAttribute(aName, null)getTypedAttribute in interface IAttributeContainer<KEYTYPE,VALUETYPE>DATATYPE - return typeaName - the attribute nameaDstClass - The destination class to convert to. May not be null.null if no such value exists@Nullable public final <DATATYPE> DATATYPE getTypedAttribute(@Nullable KEYTYPE aName, @Nonnull Class<DATATYPE> aDstClass, @Nullable DATATYPE aDefault)
IAttributeContainerIAttributeContainer.getAttributeAsString(Object, String)!getTypedAttribute in interface IAttributeContainer<KEYTYPE,VALUETYPE>DATATYPE - return typeaName - The attribute name.aDstClass - The destination class to convert to. May not be null.aDefault - The default value to be returned if no such attribute exists@Nullable public final String getAttributeAsString(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsString (aName, null)getAttributeAsString in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namenull if no such attribute
exists@Nullable public static String getAsString(@Nullable Object aParamName, @Nullable Object aValue, @Nullable String sDefault)
aParamName - The name of the parameters. Has just informal character, for
warnings. May be null.aValue - The value to be converted to a String. May be null.
Explicitly supported data types are: String, String[]. All other
data types are returned as "toString()".sDefault - The default value to be returned, if the passed value is
null or an empty String array.null or an empty
String array, the value as string otherwise. If the value is a
String[] than the first element is returned, and the other elements
are discarded.@Nullable public final String getAttributeAsString(@Nullable KEYTYPE aName, @Nullable String sDefault)
IAttributeContainergetAttributeAsString in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namesDefault - The default value to be returned, if the passed attribute name is
unknownsDefault if no such attribute
existspublic static int getAsInt(@Nullable Object aParamName, @Nullable Object aValue, int nDefault)
public final int getAttributeAsInt(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsInt in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existspublic final int getAttributeAsInt(@Nullable KEYTYPE aName, int nDefault)
IAttributeContainergetAttributeAsInt in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namenDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existspublic static long getAsLong(@Nullable Object aParamName, @Nullable Object aValue, long nDefault)
public final long getAttributeAsLong(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsLong in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute nameCGlobal.ILLEGAL_ULONG if no such
attribute existspublic final long getAttributeAsLong(@Nullable KEYTYPE aName, long nDefault)
IAttributeContainergetAttributeAsLong in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namenDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existspublic static double getAsDouble(@Nullable Object aParamName, @Nullable Object aValue, double dDefault)
public final double getAttributeAsDouble(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsDouble in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existspublic final double getAttributeAsDouble(@Nullable KEYTYPE aName, double dDefault)
IAttributeContainergetAttributeAsDouble in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namedDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existspublic static boolean getAsBoolean(@Nullable Object aParamName, @Nullable Object aValue, boolean bDefault)
public final boolean getAttributeAsBoolean(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsBoolean in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namefalse if no such attribute
existspublic final boolean getAttributeAsBoolean(@Nullable KEYTYPE aName, boolean bDefault)
IAttributeContainergetAttributeAsBoolean in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namebDefault - the default value to be returned if the value is not present or not
convertiblebDefault if no such attribute
exists@Nullable public static BigInteger getAsBigInteger(@Nullable Object aParamName, @Nullable Object aValue, @Nullable BigInteger aDefault)
@Nullable public final BigInteger getAttributeAsBigInteger(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsBigInteger in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namenull if no such attribute
exists@Nullable public final BigInteger getAttributeAsBigInteger(@Nullable KEYTYPE aName, @Nullable BigInteger aDefault)
IAttributeContainergetAttributeAsBigInteger in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute nameaDefault - the default value to be returned if the value is not present or not
convertibleaDefault if no such attribute
exists@Nullable public static BigDecimal getAsBigDecimal(@Nullable Object aParamName, @Nullable Object aValue, @Nullable BigDecimal aDefault)
@Nullable public final BigDecimal getAttributeAsBigDecimal(@Nullable KEYTYPE aName)
IAttributeContainergetAttributeAsBigDecimal in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute namenull if no such attribute
exists@Nullable public final BigDecimal getAttributeAsBigDecimal(@Nullable KEYTYPE aName, @Nullable BigDecimal aDefault)
IAttributeContainergetAttributeAsBigDecimal in interface IAttributeContainer<KEYTYPE,VALUETYPE>aName - the attribute nameaDefault - the default value to be returned if the value is not present or not
convertibleaDefault if no such attribute
existsCopyright © 2014–2015 Philip Helger. All rights reserved.