org.n52.security.common.attributes
Class Attributes

java.lang.Object
  extended by org.n52.security.common.attributes.Attributes
All Implemented Interfaces:
Serializable

public class Attributes
extends Object
implements Serializable

Collections of attributes.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 05.08.2008
See Also:
Serialized Form

Field Summary
protected  Map<String,Attribute> m_attributes
           
 
Constructor Summary
Attributes()
           
Attributes(Collection<Attribute> attributes)
           
 
Method Summary
 boolean containsAttribute(String key)
          Returns true if an attribute with the given key is present.
 boolean equals(Object o)
           
 Attribute getAttribute(String key)
          Gets an Attribute for a given key.
 Set<String> getAttributeNames()
          Gets the attribute names.
 Collection<Attribute> getAttributes()
          Gets the attributes.
 String getStringAttributeValue(String key)
          Gets the value of an Attribute with StringAttributeValue.
 int hashCode()
           
 boolean isEmpty()
           
 Attributes putAttribute(Attribute attribute)
          Method puts an attribute in the environment.
 Attributes putAttribute(String key, String value)
          Method puts a simple StringAttribute in the environment.
 Attributes putAttributes(Collection<Attribute> attributes)
          Method puts a collection of attributes in the environment.
 Attributes removeAttribute(Attribute attribute)
          Method removes the attribute from the environment.
 Attributes removeAttribute(String key)
          Method removes the attribute with the given key.
 Attributes removeAttributes(Collection<Attribute> attributes)
          Method removes all attributes in the collection.
 int size()
          Method gets the size.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_attributes

protected Map<String,Attribute> m_attributes
Constructor Detail

Attributes

public Attributes()

Attributes

public Attributes(Collection<Attribute> attributes)
Method Detail

getAttributes

public Collection<Attribute> getAttributes()
Gets the attributes. The collection is unmodifiable.

Returns:
returns the attributes.

getAttributeNames

public Set<String> getAttributeNames()
Gets the attribute names.

Returns:
returns the attributenames.

isEmpty

public boolean isEmpty()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getAttribute

public Attribute getAttribute(String key)
Gets an Attribute for a given key.

Parameters:
key - the key of the attribute.
Returns:
the found attribute or null if nothing is found.

getStringAttributeValue

public String getStringAttributeValue(String key)
Gets the value of an Attribute with StringAttributeValue.

Parameters:
key - the key of the attribute.
Returns:
the found attribute value or null if not set.

containsAttribute

public boolean containsAttribute(String key)
Returns true if an attribute with the given key is present.

Parameters:
key - a key, asserted to be not null.
Returns:
true if attribute with key is present.

putAttribute

public Attributes putAttribute(Attribute attribute)
Method puts an attribute in the environment.

Parameters:
attribute - the attribute.
Returns:
Environment.

putAttribute

public Attributes putAttribute(String key,
                               String value)
Method puts a simple StringAttribute in the environment.

Parameters:
key - the key.
value - the value.
Returns:
Environment.

putAttributes

public Attributes putAttributes(Collection<Attribute> attributes)
Method puts a collection of attributes in the environment.

Parameters:
attributes - the attributes.
Returns:
Environment.

removeAttribute

public Attributes removeAttribute(String key)
Method removes the attribute with the given key.

Parameters:
key - the key.
Returns:
Environment.

removeAttributes

public Attributes removeAttributes(Collection<Attribute> attributes)
Method removes all attributes in the collection.

Parameters:
attributes - the attributes.
Returns:
Environment.

removeAttribute

public Attributes removeAttribute(Attribute attribute)
Method removes the attribute from the environment.

Parameters:
attribute - the attribute.
Returns:
Environment.

size

public int size()
Method gets the size.

Returns:
int.


Copyright © 2004–2013 52north.org. All rights reserved.