KEYTYPE - Key typeVALUETYPE - Value type@NotThreadSafe public class MapBasedReadOnlyAttributeContainer<KEYTYPE,VALUETYPE> extends AbstractReadOnlyAttributeContainer<KEYTYPE,VALUETYPE>
IAttributeContainer based on a
HashMap. This implementation may carry null values but
that is not recommended.| Modifier and Type | Field and Description |
|---|---|
protected Map<KEYTYPE,VALUETYPE> |
m_aAttrs
Main attribute storage.
|
| Modifier | Constructor and Description |
|---|---|
protected |
MapBasedReadOnlyAttributeContainer(boolean bDummy,
Map<KEYTYPE,VALUETYPE> aAttrMap)
Constructor to use a custom map for the attribute container
|
|
MapBasedReadOnlyAttributeContainer(IAttributeContainer<? extends KEYTYPE,? extends VALUETYPE> aCont) |
|
MapBasedReadOnlyAttributeContainer(KEYTYPE aKey,
VALUETYPE aValue) |
|
MapBasedReadOnlyAttributeContainer(Map<? extends KEYTYPE,? extends VALUETYPE> aMap) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsAttribute(KEYTYPE aName)
Check if an attribute of the given name is contained.
|
boolean |
containsNoAttribute() |
boolean |
equals(Object o) |
Set<KEYTYPE> |
getAllAttributeNames() |
Map<KEYTYPE,VALUETYPE> |
getAllAttributes() |
Collection<VALUETYPE> |
getAllAttributeValues() |
int |
getAttributeCount() |
VALUETYPE |
getAttributeObject(KEYTYPE aName)
Get the attribute value associated to the given attribute name.
|
Iterator<Map.Entry<KEYTYPE,VALUETYPE>> |
getIterator() |
int |
hashCode() |
String |
toString() |
getAsBigDecimal, getAsBigInteger, getAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributepublic MapBasedReadOnlyAttributeContainer(@Nonnull KEYTYPE aKey, @Nullable VALUETYPE aValue)
public MapBasedReadOnlyAttributeContainer(@Nonnull Map<? extends KEYTYPE,? extends VALUETYPE> aMap)
public MapBasedReadOnlyAttributeContainer(@Nonnull IAttributeContainer<? extends KEYTYPE,? extends VALUETYPE> aCont)
protected MapBasedReadOnlyAttributeContainer(boolean bDummy,
@Nonnull
Map<KEYTYPE,VALUETYPE> aAttrMap)
bDummy - Dummy parameter to be used to uniquely specify the constructoraAttrMap - The attribute map to be used.@Nonnull public Iterator<Map.Entry<KEYTYPE,VALUETYPE>> getIterator()
public boolean containsAttribute(@Nullable KEYTYPE aName)
IAttributeContaineraName - name of the attribute to checktrue if the attribute is contained, false
otherwise@Nonnull @ReturnsMutableCopy public Map<KEYTYPE,VALUETYPE> getAllAttributes()
null map with all contained attributes.@Nonnull @ReturnsMutableCopy public Set<KEYTYPE> getAllAttributeNames()
null set of all attribute names.@Nonnull @ReturnsMutableCopy public Collection<VALUETYPE> getAllAttributeValues()
null collection of all attribute values.@Nullable public VALUETYPE getAttributeObject(@Nullable KEYTYPE aName)
IAttributeContaineraName - the attribute namenull if no such value exists@Nonnegative public int getAttributeCount()
public boolean containsNoAttribute()
true if this attribute container does not contain any
attribute at all, false if at least one attribute is
contained.Copyright © 2014–2016 Philip Helger. All rights reserved.