|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.
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 |
---|
boolean isNull(java.lang.String key)
key
- The input key
boolean isBlankOrNull(java.lang.String key)
key
- The input key
java.lang.Object get(java.lang.String key)
key
- The input key
java.lang.String getString(java.lang.String key)
key
- The input key
java.lang.Boolean getBoolean(java.lang.String key)
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.
java.lang.Integer getInteger(java.lang.String key)
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.
java.util.List getList(java.lang.String key)
key
- The input key
java.util.List getKeys()
void set(java.lang.String key, java.lang.Object value)
key
- The input keyThe
- object to be storedvoid remove(java.lang.String key)
key
- The input key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |