at.ac.tuwien.infosys.sm4all.copal.api.event
Class Attributes

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.Attributes

public class Attributes
extends Object

Representation of a list of Attributes.

Author:
sanjin

Constructor Summary
Attributes()
           
 
Method Summary
 void add(String name, String value)
          Adds Attribute with specified name to specified value.
 boolean contains(String name)
          Returns if an Attribute that has specified name is currently present in this list.
 String get(String name)
          Returns the value of Attribute with specified name.
 Attribute[] getAll()
          Returns all currently added Attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Attributes

public Attributes()
Method Detail

add

public void add(String name,
                String value)
Adds Attribute with specified name to specified value. If the value is null the Attribute will be removed and consequent calls to contains(String) with same name of Attribute will return false.

Parameters:
name - the name of Attribute.
value - the value of Attribute.
Throws:
NullPointerException - if specified name of Attribute is null.
IllegalArgumentException - if specified name of Attribute is an empty or blank string.

get

public String get(String name)
Returns the value of Attribute with specified name. If this list does not have Attribute with specified name, null will be returned.

Parameters:
name - the name of Attribute.
Returns:
the value of Attribute or null if there is no such Attribute.

getAll

public Attribute[] getAll()
Returns all currently added Attributes.

Returns:
all currently added Attributes.

contains

public boolean contains(String name)
Returns if an Attribute that has specified name is currently present in this list. If the Attribute was never added (or was added and consequently removed by adding it with null value), false will be returned; otherwise true will be returned.

Parameters:
name - the name of Attribute.
Returns:
if an Attribute that has specified name is currently present in this list.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.