KEYTYPE - Key typeVALUETYPE - Value typepublic interface IAttributeContainer<KEYTYPE,VALUETYPE> extends ICommonsIterable<Map.Entry<KEYTYPE,VALUETYPE>>, Serializable
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAttribute(KEYTYPE aName)
Check if an attribute of the given name is contained.
|
void |
forAllAttributes(BiConsumer<? super KEYTYPE,? super VALUETYPE> aConsumer)
Perform an operation on all contained attributes.
|
void |
forAllAttributeValues(Consumer<? super VALUETYPE> aConsumer)
Perform an operation on all contained attribute values.
|
ICommonsSet<KEYTYPE> |
getAllAttributeNames() |
ICommonsMap<KEYTYPE,VALUETYPE> |
getAllAttributes() |
ICommonsCollection<VALUETYPE> |
getAllAttributeValues() |
default BigDecimal |
getAttributeAsBigDecimal(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default BigDecimal |
getAttributeAsBigDecimal(KEYTYPE aName,
BigDecimal aDefault)
Get the attribute value associated to the given attribute name.
|
default BigInteger |
getAttributeAsBigInteger(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default BigInteger |
getAttributeAsBigInteger(KEYTYPE aName,
BigInteger aDefault)
Get the attribute value associated to the given attribute name.
|
default boolean |
getAttributeAsBoolean(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default boolean |
getAttributeAsBoolean(KEYTYPE aName,
boolean bDefault)
Get the attribute value associated to the given attribute name.
|
default double |
getAttributeAsDouble(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default double |
getAttributeAsDouble(KEYTYPE aName,
double dDefault)
Get the attribute value associated to the given attribute name.
|
default int |
getAttributeAsInt(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default int |
getAttributeAsInt(KEYTYPE aName,
int nDefault)
Get the attribute value associated to the given attribute name.
|
default long |
getAttributeAsLong(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default long |
getAttributeAsLong(KEYTYPE aName,
long nDefault)
Get the attribute value associated to the given attribute name.
|
default String |
getAttributeAsString(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default 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.
|
default <DATATYPE> DATATYPE |
getCastedAttribute(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
default <DATATYPE> DATATYPE |
getCastedAttribute(KEYTYPE aName,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
default <DATATYPE> DATATYPE |
getTypedAttribute(KEYTYPE aName,
Class<DATATYPE> aDstClass)
Get the attribute value associated to the given attribute name.
|
default <DATATYPE> DATATYPE |
getTypedAttribute(KEYTYPE aName,
Class<DATATYPE> aDstClass,
DATATYPE aDefault)
Get the attribute value associated to the given attribute name.
|
boolean |
isEmpty() |
default boolean |
isNotEmpty() |
Iterator<Map.Entry<KEYTYPE,VALUETYPE>> |
iterator() |
containsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstMapped, findFirstMapped, forEach, forEach, forEachBreakable, getIteratorCount, getIteratorCountforEach, spliterator@Nonnegative int getAttributeCount()
boolean isEmpty()
true if this attribute container does not contain any
attribute at all, false if at least one attribute is
contained.default boolean isNotEmpty()
boolean containsAttribute(@Nullable KEYTYPE aName)
aName - name of the attribute to checktrue if the attribute is contained, false
otherwise@Nonnull @ReturnsMutableCopy ICommonsMap<KEYTYPE,VALUETYPE> getAllAttributes()
null map with all contained attributes.void forAllAttributes(@Nonnull BiConsumer<? super KEYTYPE,? super VALUETYPE> aConsumer)
aConsumer - The consumer to be invoked.void forAllAttributeValues(@Nonnull Consumer<? super VALUETYPE> aConsumer)
aConsumer - The consumer to be invoked.@Nullable VALUETYPE getAttributeObject(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such value exists@Nullable default <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 default <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 default <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 default <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 default String getAttributeAsString(@Nullable KEYTYPE aName)
getAttributeAsString (aName, null)aName - the attribute namenull if no such attribute
exists@Nullable default 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
existsdefault int getAttributeAsInt(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existsdefault int 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
existsdefault long getAttributeAsLong(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_ULONG if no such
attribute existsdefault long 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
existsdefault double getAttributeAsDouble(@Nullable KEYTYPE aName)
aName - the attribute nameCGlobal.ILLEGAL_UINT if no such
attribute existsdefault double 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
existsdefault boolean getAttributeAsBoolean(@Nullable KEYTYPE aName)
aName - the attribute namefalse if no such attribute
existsdefault boolean 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 default BigInteger getAttributeAsBigInteger(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such attribute
exists@Nullable default 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 default BigDecimal getAttributeAsBigDecimal(@Nullable KEYTYPE aName)
aName - the attribute namenull if no such attribute
exists@Nullable default 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 ICommonsSet<KEYTYPE> getAllAttributeNames()
null set of all attribute names.@Nonnull @ReturnsMutableCopy ICommonsCollection<VALUETYPE> getAllAttributeValues()
null collection of all attribute values.Copyright © 2014–2017 Philip Helger. All rights reserved.