java.lang.Object | |
↳ | mason.hardware.platform.CommandParameter |
A helper class to construct the commands parameter additional data into a single object.
CommandParameter metadataParameter = new CommandParameter(); metadataParameter.addIntegerParameter("age", 97); metadataParameter.addIntegerParameter("height", 180); metadataParameter.addIntegerParameter("weight", 10); metadataParameter.addIntegerParameter("gender", 0);
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Construct the CommandParameter form string data
| |||||||||||
Add pair of (key, value) to the
CommandParameter
where value will be treated as type Integer
| |||||||||||
Add pair of (key, value) to the
CommandParameter
were value will be treated as type String
| |||||||||||
Returns the integer value to which the key is mapped.
| |||||||||||
Returns the string value to which the key is mapped.
| |||||||||||
Converts the
CommandParameter object to JSONObject.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Construct the CommandParameter form string data
Parameters | |
---|---|
data |
String : string to construct the CommandParameter |
Returns | |
---|---|
CommandParameter |
the CommandParameter object to be used on the
command execution
|
Add pair of (key, value) to the CommandParameter
where value will be treated as type Integer
Parameters | |
---|---|
key |
String : the expected identifier, specific per command |
value |
Integer : the value to assign to this key.
|
Add pair of (key, value) to the CommandParameter
were value will be treated as type String
Parameters | |
---|---|
key |
String : the expected identifier, specific per command |
value |
String : the value to assign to this key.
|
Returns the integer value to which the key is mapped. Returns null if key does not exist.
Parameters | |
---|---|
key |
String : the expected identifier, specific per command. |
Returns | |
---|---|
Integer |
value maped to key. |
Returns the string value to which the key is mapped. Returns null if key does not exist.
Parameters | |
---|---|
key |
String : the expected identifier, specific per command. |
Returns | |
---|---|
String |
value maped to key. |
Converts the CommandParameter
object to JSONObject.
Returns | |
---|---|
JSONObject |
JSONObject equivalent to the CommandParameter object |
Throws | |
---|---|
JSONException |