class Callback extends SampMap
CallableClient
interface.Modifier and Type | Field and Description |
---|---|
private static java.lang.String[] |
KNOWN_KEYS |
static java.lang.String |
METHODNAME_KEY
Key for the callback method name (a string).
|
static java.lang.String |
PARAMS_KEY
Key for the callback parameters (a list).
|
Constructor and Description |
---|
Callback()
Constructs an empty callback.
|
Callback(java.util.Map map)
Constructs a callback based on an existing map.
|
Callback(java.lang.String methodName,
java.util.List params)
Constructs a callback given a method name and parameter list.
|
Modifier and Type | Method and Description |
---|---|
static Callback |
asCallback(java.util.Map map)
Returns a given map as a Callback object.
|
void |
check()
Checks that this object is ready for use with the SAMP toolkit.
|
java.lang.String |
getMethodName()
Returns the method name.
|
java.util.List |
getParams()
Returns the parameter list.
|
void |
setMethodName(java.lang.String methodName)
Sets the method name.
|
void |
setParams(java.util.List params)
Sets the parameter list.
|
checkHasKeys, entrySet, getList, getMap, getString, getUrl, put
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, putAll, remove, size, toString, values
public static final java.lang.String METHODNAME_KEY
public static final java.lang.String PARAMS_KEY
private static final java.lang.String[] KNOWN_KEYS
public Callback()
public Callback(java.util.Map map)
map
- contentspublic Callback(java.lang.String methodName, java.util.List params)
public void setMethodName(java.lang.String methodName)
methodName
- method namepublic java.lang.String getMethodName()
public void setParams(java.util.List params)
params
- parameter listpublic java.util.List getParams()
public void check()
SampMap
SampUtils.checkMap(java.util.Map)
(ensuring that all keys
are Strings, and all values Strings, Lists or Maps), subclass-specific
invariants may be checked. In the case that there's something wrong,
an informative DataException
will be thrown.public static Callback asCallback(java.util.Map map)
map
- map