Class DefaultParameterObject
- java.lang.Object
-
- org.mwolff.command.parameterobject.DefaultParameterObject
-
- All Implemented Interfaces:
GenericParameterObject
public class DefaultParameterObject extends Object implements GenericParameterObject
A simple implementation of a generic context.
-
-
Field Summary
Fields Modifier and Type Field Description static GenericParameterObject
NULLCONTEXT
A null context to execute commands without a context.
-
Constructor Summary
Constructors Constructor Description DefaultParameterObject()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
get(String key)
Returns the object of the given key.String
getAsString(String key)
Returns the object of the given key as String.static GenericParameterObject
getInstance()
Gets a fresh instance of an GenericParameterObjectstatic GenericParameterObject
getStandardContext()
static GenericParameterObject
getStandardContext(String key, Object value)
void
put(String key, Object value)
Saves an object to the key.
-
-
-
Field Detail
-
NULLCONTEXT
public static final GenericParameterObject NULLCONTEXT
A null context to execute commands without a context.
-
-
Method Detail
-
getInstance
public static final GenericParameterObject getInstance()
Gets a fresh instance of an GenericParameterObject- Returns:
- The fresh instance
-
get
public Object get(String key)
Description copied from interface:GenericParameterObject
Returns the object of the given key.- Specified by:
get
in interfaceGenericParameterObject
- Parameters:
key
- The given key to return the value.- Returns:
- The value of the key
- See Also:
GenericParameterObject.get(java.lang.String)
-
getAsString
public String getAsString(String key)
Description copied from interface:GenericParameterObject
Returns the object of the given key as String.- Specified by:
getAsString
in interfaceGenericParameterObject
- Parameters:
key
- The given key to return a value as String.- Returns:
- The value of the key as string.
- See Also:
GenericParameterObject.getAsString(java.lang.String)
-
put
public void put(String key, Object value)
Description copied from interface:GenericParameterObject
Saves an object to the key.- Specified by:
put
in interfaceGenericParameterObject
- Parameters:
key
- the key.value
- the key.- See Also:
GenericParameterObject.put(java.lang.String, java.lang.Object)
-
getStandardContext
public static GenericParameterObject getStandardContext()
-
getStandardContext
public static GenericParameterObject getStandardContext(String key, Object value)
-
-