com.mycila.testing.core.api
Interface Attributes


public interface Attributes

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Method Summary
 Map<String,Object> all()
           
<T> T
get(String name)
          Get an attribute from this context
 boolean has(String name)
          Check if the context has a specific attribute
<T> T
remove(String name)
          Removes an attribute.
 void set(String name, Object value)
          Set an attribute
 

Method Detail

get

<T> T get(String name)
      throws TestPluginException
Get an attribute from this context

Type Parameters:
T - Infered type of the attribute
Parameters:
name - Attribute name (should be unique amongst all attribute names)
Returns:
The attribute value
Throws:
TestPluginException - If the attribute does not exist (and thus we cannot get its value)

set

void set(String name,
         Object value)
Set an attribute

Parameters:
name - Attribute name (should be unique amongst all attribute names)
value - Attribute Value

has

boolean has(String name)
Check if the context has a specific attribute

Parameters:
name - Attribute name
Returns:
True if this attribute exists, false otherwise

remove

<T> T remove(String name)
Removes an attribute. Does nothing if attribute does not exist.

Type Parameters:
T - Inferred attribute type
Parameters:
name - Attribute name
Returns:
The removed attribute or null if none has been removed

all

Map<String,Object> all()
Returns:
All attributes from this context


Copyright © 2008-2011 Mycila. All Rights Reserved.