Package io.openems.common.jsonrpc.base
Class GenericJsonrpcNotification
java.lang.Object
io.openems.common.jsonrpc.base.JsonrpcMessage
io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
io.openems.common.jsonrpc.base.JsonrpcNotification
io.openems.common.jsonrpc.base.GenericJsonrpcNotification
Represents a generic JSON-RPC Notification.
{ "jsonrpc": "2.0", "method": string, "params": {} }
- See Also:
-
Field Summary
Fields inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
JSONRPC_VERSION
-
Constructor Summary
ConstructorsConstructorDescriptionGenericJsonrpcNotification
(String method, com.google.gson.JsonObject params) -
Method Summary
Modifier and TypeMethodDescriptionstatic GenericJsonrpcNotification
from
(com.google.gson.JsonObject j) Parses aJsonObject
to aGenericJsonrpcNotification
.static GenericJsonrpcNotification
Parses a JSON String to aGenericJsonrpcNotification
.com.google.gson.JsonObject
Gets the paramsJsonObject
of theJsonrpcRequest
.Methods inherited from class io.openems.common.jsonrpc.base.AbstractJsonrpcRequest
getFullyQualifiedMethod, getMethod, toJsonObject
Methods inherited from class io.openems.common.jsonrpc.base.JsonrpcMessage
toString
-
Constructor Details
-
GenericJsonrpcNotification
-
-
Method Details
-
from
public static GenericJsonrpcNotification from(String json) throws OpenemsError.OpenemsNamedException Parses a JSON String to aGenericJsonrpcNotification
.- Parameters:
json
- the JSON String- Returns:
- the
GenericJsonrpcNotification
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
from
public static GenericJsonrpcNotification from(com.google.gson.JsonObject j) throws OpenemsError.OpenemsNamedException Parses aJsonObject
to aGenericJsonrpcNotification
.- Parameters:
j
- theJsonObject
- Returns:
- the
GenericJsonrpcNotification
- Throws:
OpenemsError.OpenemsNamedException
- on error
-
getParams
public com.google.gson.JsonObject getParams()Description copied from class:AbstractJsonrpcRequest
Gets the paramsJsonObject
of theJsonrpcRequest
.- Specified by:
getParams
in classAbstractJsonrpcRequest
- Returns:
- the params as
JsonObject
-