public class MethodParser
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
MethodParser.Operation |
| Constructor and Description |
|---|
MethodParser()
CONSTRUCTOR
Create a MethodParser instance with provided values.
|
MethodParser(com.google.gson.JsonElement payload)
CONSTRUCTOR
Create a MethodParser instance with provided values.
|
MethodParser(java.lang.String name,
java.lang.Long responseTimeout,
java.lang.Long connectTimeout,
com.google.gson.JsonElement payload)
CONSTRUCTOR
Create a MethodParser instance with provided values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
fromJson(java.lang.String json)
Set the Method collection with the provided information in the json.
|
com.google.gson.JsonElement |
getPayload()
Return an Object with the payload.
|
com.google.gson.JsonElement |
getPayloadFromJson(java.lang.String json) |
java.lang.String |
toJson()
Create a String with a json content that represents all the information in the method collection.
|
com.google.gson.JsonElement |
toJsonElement()
Create a JsonElement with a content that represents all the information in the method collection.
|
public MethodParser()
public MethodParser(java.lang.String name,
java.lang.Long responseTimeout,
java.lang.Long connectTimeout,
com.google.gson.JsonElement payload)
throws java.lang.IllegalArgumentException
name - - method name [required].responseTimeout - - maximum interval of time, in seconds, that the Direct Method will wait for answer. It can be null.connectTimeout - - maximum interval of time, in seconds, that the Direct Method will wait for the connection. It can be null.payload - - Object that contains the payload defined by the user. It can be null.java.lang.IllegalArgumentException - This exception is thrown if the one of the provided information do not fits the requirements.public MethodParser(com.google.gson.JsonElement payload)
payload - - Object that contains the payload defined by the user. It can be null.public void fromJson(java.lang.String json)
throws java.lang.IllegalArgumentException
json - - Json with the information to change the collection.
- If contains `methodName`, it is a full method including `methodName`, `responseTimeoutInSeconds`, `connectTimeoutInSeconds`, and `payload`.
- If contains `status`, it is a response with `status` and `payload`.
- Otherwise, it is only `payload`.java.lang.IllegalArgumentException - This exception is thrown if the one of the provided information do not fits the requirements.public com.google.gson.JsonElement getPayloadFromJson(java.lang.String json)
public com.google.gson.JsonElement getPayload()
null.public java.lang.String toJson()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - This exception is thrown if the one of the provided information do not fits the requirements.public com.google.gson.JsonElement toJsonElement()
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException - This exception is thrown if the one of the provided information do not fits the requirements.Copyright © 2023. All rights reserved.