KEYTYPE - Key typeVALUETYPE - Value typepublic interface IAttributeContainer<KEYTYPE,VALUETYPE> extends Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAttribute(KEYTYPE aName)
Check if an attribute of the given name is contained.
|
boolean |
containsNoAttribute() |
Set<KEYTYPE> |
getAllAttributeNames() |
Map<KEYTYPE,VALUETYPE> |
getAllAttributes() |
Collection<VALUETYPE> |
getAllAttributeValues() |
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.
|
int |
getAttributeCount() |
VALUETYPE |
getAttributeObject(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
<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.
|
Iterator<Map.Entry<KEYTYPE,VALUETYPE>> |
getIterator() |
<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.
|
@Nonnegative int getAttributeCount()
boolean containsNoAttribute()
true if this attribute container does not contain any
attribute at all, false if at least one attribute is
contained.boolean containsAttribute(@Nullable KEYTYPE aName)
aName - name of the attribute to checktrue if the attribute is contained, false
otherwise@Nonnull @ReturnsMutableCopy Map<KEYTYPE,VALUETYPE> getAllAttributes()
null map with all contained attributes.@Nullable VALUETYPE getAttributeObject(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such value exists@Nullable <DATATYPE> DATATYPE getCastedAttribute(@Nullable KEYTYPE aName)
ClassCastException is thrown! If you just want to
retrieve a String, use getAttributeAsString(Object)!getCastedAttribute(aName, null)DATATYPE - return typeaName - the attribute namenull if no such value exists@Nullable <DATATYPE> DATATYPE getCastedAttribute(@Nullable KEYTYPE aName, @Nullable DATATYPE aDefault)
ClassCastException is thrown! If you just want to
retrieve a String, use getAttributeAsString(Object, String)!DATATYPE - return typeaName - The attribute name.aDefault - The default value to be returned if no such attribute exists@Nullable <DATATYPE> DATATYPE getTypedAttribute(@Nullable KEYTYPE aName, @Nonnull Class<DATATYPE> aDstClass)
getAttributeAsString(Object)!getTypedAttribute(aName, null)DATATYPE - return typeaName - the attribute nameaDstClass - The destination class to convert to. May not be null.null if no such value exists@Nullable <DATATYPE> DATATYPE getTypedAttribute(@Nullable KEYTYPE aName, @Nonnull Class<DATATYPE> aDstClass, @Nullable DATATYPE aDefault)
getAttributeAsString(Object, String)!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 String getAttributeAsString(@Nullable KEYTYPE aName)
getAttributeAsString (aName, null)aName - the attribute namenull if no such attribute
exists@Nullable String getAttributeAsString(@Nullable KEYTYPE aName, @Nullable String sDefault)
aName - the attribute namesDefault - The default value to be returned, if the passed attribute name is
unknownsDefault if no such attribute
existsint getAttributeAsInt(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existsint getAttributeAsInt(@Nullable KEYTYPE aName, int nDefault)
aName - the attribute namenDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existslong getAttributeAsLong(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_ULONG if no such
attribute existslong getAttributeAsLong(@Nullable KEYTYPE aName, long nDefault)
aName - the attribute namenDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existsdouble getAttributeAsDouble(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existsdouble getAttributeAsDouble(@Nullable KEYTYPE aName, double dDefault)
aName - the attribute namedDefault - the default value to be returned if the value is not present or not
convertiblenDefault if no such attribute
existsboolean getAttributeAsBoolean(@Nullable KEYTYPE aName)
aName - the attribute namefalse if no such attribute
existsboolean getAttributeAsBoolean(@Nullable KEYTYPE aName, boolean bDefault)
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 BigInteger getAttributeAsBigInteger(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such attribute
exists@Nullable BigInteger getAttributeAsBigInteger(@Nullable KEYTYPE aName, @Nullable BigInteger aDefault)
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 BigDecimal getAttributeAsBigDecimal(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such attribute
exists@Nullable BigDecimal getAttributeAsBigDecimal(@Nullable KEYTYPE aName, @Nullable BigDecimal aDefault)
aName - the attribute nameaDefault - the default value to be returned if the value is not present or not
convertibleaDefault if no such attribute
exists@Nonnull @ReturnsMutableCopy Set<KEYTYPE> getAllAttributeNames()
null set of all attribute names.@Nonnull @ReturnsMutableCopy Collection<VALUETYPE> getAllAttributeValues()
null collection of all attribute values.Copyright © 2014–2016 Philip Helger. All rights reserved.