it.eng.spagobi.container
Interface IContainer

All Known Subinterfaces:
ISessionContainer
All Known Implementing Classes:
AbstractContainer, ContextManager, SpagoBIRequestContainer, SpagoBISessionContainer

public interface IContainer

Interface for a generic container (i.e. an object where I can put and retrieve other objects). Objects are stored with a key that is a String.

Author:
Zerbetto (davide.zerbetto@eng.it)

Method Summary
 java.lang.Object get(java.lang.String key)
          Return the object with the given key
 java.lang.Boolean getBoolean(java.lang.String key)
          If the key has no objects associated, null is returned.
 java.lang.Integer getInteger(java.lang.String key)
          If the key has no objects associated, null is returned.
 java.util.List getKeys()
          Returns all the string keys of the objects stored into this container
 java.util.List getList(java.lang.String key)
          If the key has no objects associated, null is returned.
 java.lang.String getString(java.lang.String key)
          Returns the string representation of the object with the given key; if the key has no objects associated, null is returned
 boolean isBlankOrNull(java.lang.String key)
          Returns true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise
 boolean isNull(java.lang.String key)
          Returns true if no objects are stored into the container with the input key, false otherwise
 void remove(java.lang.String key)
          Removes the object associated to the given key
 void set(java.lang.String key, java.lang.Object value)
          Store an object with the given key inside this container.
 

Method Detail

isNull

boolean isNull(java.lang.String key)
Returns true if no objects are stored into the container with the input key, false otherwise

Parameters:
key - The input key
Returns:
true if no objects are stored into the container with the input key, false otherwise

isBlankOrNull

boolean isBlankOrNull(java.lang.String key)
Returns true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise

Parameters:
key - The input key
Returns:
true true if no objects are stored into the container with the input key or if the relevant object exists and its string representation is blank, false otherwise

get

java.lang.Object get(java.lang.String key)
Return the object with the given key

Parameters:
key - The input key
Returns:
the object with the given key

getString

java.lang.String getString(java.lang.String key)
Returns the string representation of the object with the given key; if the key has no objects associated, null is returned

Parameters:
key - The input key
Returns:
the string representation of the object with the given key; if the key has no objects associated, null is returned

getBoolean

java.lang.Boolean getBoolean(java.lang.String key)
If the key has no objects associated, null is returned. If a Boolean object is associated to that key, this Boolean is returned. Otherwise the string representation of the object is parsed with Boolean.parseBoolean(string); and the result is returned.

Parameters:
key - The input key
Returns:
If the key has no objects associated, null is returned. If a Boolean object is associated to that key, this boolean is returned. Otherwise the string representation of the object is parsed with Boolean.parseBoolean(string); and the result is returned.

getInteger

java.lang.Integer getInteger(java.lang.String key)
If the key has no objects associated, null is returned. If a Integer object is associated to that key, this Integer is returned. Otherwise the string representation of the object is parsed with Integer.parseInt(string); and the result is returned.

Parameters:
key - The input key
Returns:
If the key has no objects associated, null is returned. If a Integer object is associated to that key, this Integer is returned. Otherwise the string representation of the object is parsed with Integer.parseInt(string); and the result is returned.

getList

java.util.List getList(java.lang.String key)
If the key has no objects associated, null is returned. Otherwise the object is casted to List and returned.

Parameters:
key - The input key
Returns:
If the key has no objects associated, null is returned. Otherwise the object is casted to List and returned.

getKeys

java.util.List getKeys()
Returns all the string keys of the objects stored into this container

Returns:
all the string keys of the objects stored into this container

set

void set(java.lang.String key,
         java.lang.Object value)
Store an object with the given key inside this container. If the key is null or the object is null, the container is not modified

Parameters:
key - The input key
The - object to be stored

remove

void remove(java.lang.String key)
Removes the object associated to the given key

Parameters:
key - The input key