Package eliasstar.jsonrpc.objects
Class Error
- java.lang.Object
-
- eliasstar.jsonrpc.objects.Error
-
public final class Error extends Object
Represents a JSON-RPC error contained in aResponse
.- Since:
- 0.1.0
- Author:
- Elias*
- See Also:
- JSON-RPC Specification
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
code()
Getter for error code field.protected String
contentAsJsonString()
Optional<com.google.gson.JsonElement>
data()
Getter for error data field.boolean
equals(Object obj)
This method returnstrue
if the argument is aError
and all properties are equal, otherwise returnsfalse
.int
hashCode()
This method is implemented usingObjects.hash()
.String
message()
Getter for error message field.String
toString()
-
-
-
Method Detail
-
code
public long code()
Getter for error code field.- Returns:
- The error code
-
message
public String message()
Getter for error message field.- Returns:
- The message
-
data
public Optional<com.google.gson.JsonElement> data()
Getter for error data field.- Returns:
- The additional data
-
hashCode
public int hashCode()
This method is implemented usingObjects.hash()
.
-
equals
public boolean equals(Object obj)
This method returnstrue
if the argument is aError
and all properties are equal, otherwise returnsfalse
.
-
toString
public String toString()
-
-