Parameters class
A wrapper for the parameters to a server method.
JSON-RPC 2.0 allows parameters that are either a list or a map. This class provides functions that not only assert that the parameters object is the correct type, but also that the expected arguments exist and are themselves the correct type.
Example usage:
server.registerMethod("subtract", (params) {
return params["minuend"].asNum - params["subtrahend"].asNum;
});
- Implementers
Constructors
- Parameters(String method, dynamic value)
Properties
- asList → List
-
Asserts that value exists and is a List and returns it.
no setter
- asMap → Map
-
Asserts that value exists and is a Map and returns it.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- method → String
-
The name of the method that this request called.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → dynamic
-
The underlying value of the parameters object.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
dynamic key) → Parameter - Returns a single parameter.