org.specrunner.pipeline.core
Class ChannelImpl

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Object>
          extended by org.specrunner.pipeline.core.ChannelImpl
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, IChannel

public class ChannelImpl
extends HashMap<String,Object>
implements IChannel

Default implementation of a channel.

Author:
Thiago Santos
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ChannelImpl()
          Super class constructor.
ChannelImpl(int initialCapacity)
          Super class constructor.
ChannelImpl(int initialCapacity, float loadFactor)
          Super class constructor.
ChannelImpl(Map<? extends String,? extends Object> m)
          Super class constructor.
 
Method Summary
 IChannel add(String key, Object value)
          Add data to the channel.
<T> T
get(String key, Class<T> type)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

ChannelImpl

public ChannelImpl()
Super class constructor.


ChannelImpl

public ChannelImpl(int initialCapacity,
                   float loadFactor)
Super class constructor.

Parameters:
initialCapacity - see new Map(initialCapacity,loadFactor)
loadFactor - see new Map(initialCapacity,loadFactor)

ChannelImpl

public ChannelImpl(int initialCapacity)
Super class constructor.

Parameters:
initialCapacity - see new Map(initialCapacity,loadFactor)

ChannelImpl

public ChannelImpl(Map<? extends String,? extends Object> m)
Super class constructor.

Parameters:
m - see new Map(m)
Method Detail

add

public IChannel add(String key,
                    Object value)
Description copied from interface: IChannel
Add data to the channel.

Specified by:
add in interface IChannel
Parameters:
key - The data key.
value - The data value.
Returns:
The channel itself.

get

public <T> T get(String key,
                 Class<T> type)
      throws NotFoundException,
             InvalidTypeException
Specified by:
get in interface IChannel
Type Parameters:
T - The expected type.
Parameters:
key - The object name.
type - The object type.
Returns:
The object instance.
Throws:
NotFoundException - If key is not present.
InvalidTypeException - If type does not match.


Copyright © 2014. All rights reserved.