@ThreadSafe public class MapBasedAttributeContainerThreadSafe extends MapBasedAttributeContainer
MapBasedAttributeContainer!| Modifier and Type | Field and Description |
|---|---|
protected ReadWriteLock |
m_aRWLock |
| Constructor and Description |
|---|
MapBasedAttributeContainerThreadSafe() |
MapBasedAttributeContainerThreadSafe(IReadonlyAttributeContainer aCont) |
MapBasedAttributeContainerThreadSafe(Map<String,?> aMap) |
| Modifier and Type | Method and Description |
|---|---|
EChange |
clear()
Reset the contents of the element to the after-construction state.
|
boolean |
containsAttribute(String sName)
Check if an attribute of the given name is contained.
|
boolean |
containsNoAttribute() |
boolean |
equals(Object o) |
Set<String> |
getAllAttributeNames() |
Map<String,Object> |
getAllAttributes() |
Collection<Object> |
getAllAttributeValues() |
boolean |
getAndSetAttributeFlag(String sName)
Atomic operation to set a flag to
true if it was previously
set to false (meaning not existing). |
int |
getAttributeCount() |
Enumeration<String> |
getAttributeNames()
Get an enumerator over all contained attribute names.
|
Object |
getAttributeObject(String sName)
Get the attribute value associated to the given attribute name.
|
MapBasedAttributeContainerThreadSafe |
getClone() |
int |
hashCode() |
EChange |
removeAttribute(String sName)
Remove the specified attribute from the container.
|
EChange |
setAttribute(String sName,
Object aValue)
Set/overwrite an attribute value.
|
setAttribute, setAttribute, setAttribute, setAttributeonBeforeRemoveAttribute, onBeforeSetAttributeValue, setAttributes, setAttributes, toStringgetAsBigDecimal, getAsBigInteger, getAsBoolean, getAsDouble, getAsInt, getAsLong, getAsString, getAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeclone, finalize, getClass, notify, notifyAll, wait, wait, waitsetAttributes, setAttributesgetAttributeAsBigDecimal, getAttributeAsBigDecimal, getAttributeAsBigInteger, getAttributeAsBigInteger, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDouble, getAttributeAsDouble, getAttributeAsInt, getAttributeAsInt, getAttributeAsLong, getAttributeAsLong, getAttributeAsString, getAttributeAsString, getCastedAttribute, getCastedAttribute, getTypedAttribute, getTypedAttributeprotected final ReadWriteLock m_aRWLock
public MapBasedAttributeContainerThreadSafe()
public MapBasedAttributeContainerThreadSafe(@Nonnull Map<String,?> aMap)
public MapBasedAttributeContainerThreadSafe(@Nonnull IReadonlyAttributeContainer aCont)
public boolean containsAttribute(@Nullable String sName)
IGenericReadonlyAttributeContainercontainsAttribute in interface IGenericReadonlyAttributeContainer<String,Object>containsAttribute in class MapBasedGenericAttributeContainer<String,Object>sName - name of the attribute to checktrue if the attribute is contained, false
otherwise@Nonnull @ReturnsMutableCopy public Map<String,Object> getAllAttributes()
getAllAttributes in interface IGenericReadonlyAttributeContainer<String,Object>getAllAttributes in class MapBasedGenericAttributeContainer<String,Object>null map with all contained attributes.@Nullable public Object getAttributeObject(@Nullable String sName)
IGenericReadonlyAttributeContainergetAttributeObject in interface IGenericReadonlyAttributeContainer<String,Object>getAttributeObject in class MapBasedGenericAttributeContainer<String,Object>sName - the attribute namenull if no such value exists@Nonnull public EChange setAttribute(@Nonnull String sName, @Nullable Object aValue)
IGenericAttributeContainersetAttribute in interface IGenericAttributeContainer<String,Object>setAttribute in class MapBasedGenericAttributeContainer<String,Object>sName - The name of the attribute. May not be null.aValue - The value of the attribute. If it is null, the value
will be removed.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.IGenericAttributeContainer.removeAttribute(Object)@Nonnull public EChange removeAttribute(@Nullable String sName)
IGenericAttributeContainerremoveAttribute in interface IGenericAttributeContainer<String,Object>removeAttribute in class MapBasedGenericAttributeContainer<String,Object>sName - The attribute name to be removed. If it is null nothing
happens.EChange.CHANGED if something changed,
EChange.UNCHANGED otherwise.@Nonnull @ReturnsMutableCopy public Enumeration<String> getAttributeNames()
IGenericReadonlyAttributeContainergetAttributeNames in interface IGenericReadonlyAttributeContainer<String,Object>getAttributeNames in class MapBasedGenericAttributeContainer<String,Object>@Nonnull @ReturnsMutableCopy public Set<String> getAllAttributeNames()
getAllAttributeNames in interface IGenericReadonlyAttributeContainer<String,Object>getAllAttributeNames in class MapBasedGenericAttributeContainer<String,Object>@Nonnull @ReturnsMutableCopy public Collection<Object> getAllAttributeValues()
getAllAttributeValues in interface IGenericReadonlyAttributeContainer<String,Object>getAllAttributeValues in class MapBasedGenericAttributeContainer<String,Object>@Nonnegative public int getAttributeCount()
getAttributeCount in interface IGenericReadonlyAttributeContainer<String,Object>getAttributeCount in class MapBasedGenericAttributeContainer<String,Object>public boolean containsNoAttribute()
containsNoAttribute in interface IGenericReadonlyAttributeContainer<String,Object>containsNoAttribute in class MapBasedGenericAttributeContainer<String,Object>true if this attribute container does not contain any
attribute at all, false if at least one attribute is
contained.@Nonnull public EChange clear()
IClearableclear in interface IClearableclear in class MapBasedGenericAttributeContainer<String,Object>EChange.CHANGED if at least one element was cleared,
EChange.UNCHANGED otherwise.public boolean getAndSetAttributeFlag(@Nonnull String sName)
IAttributeContainertrue if it was previously
set to false (meaning not existing). There is no possibility
to define a value for this flag. The value used is Boolean.TRUE.
#containsAttribute(String) can be used to check if the attribute is
already present.getAndSetAttributeFlag in interface IAttributeContainergetAndSetAttributeFlag in class MapBasedAttributeContainersName - The name of the flag to set.false is returned, whereas if the flag was
already present, true is returned. Any other than the
first call for the same flag is always returning true.@Nonnull public MapBasedAttributeContainerThreadSafe getClone()
getClone in interface ICloneable<MapBasedGenericAttributeContainer<String,Object>>getClone in class MapBasedAttributeContainerpublic boolean equals(Object o)
equals in class MapBasedGenericAttributeContainer<String,Object>public int hashCode()
hashCode in class MapBasedGenericAttributeContainer<String,Object>Copyright © 2014 Philip Helger. All rights reserved.