Class ThrowableJsonAdapter
java.lang.Object
org.eclipse.keyple.core.util.json.ThrowableJsonAdapter
- All Implemented Interfaces:
com.google.gson.JsonDeserializer<Throwable>
,com.google.gson.JsonSerializer<Throwable>
public class ThrowableJsonAdapter
extends Object
implements com.google.gson.JsonSerializer<Throwable>, com.google.gson.JsonDeserializer<Throwable>
JSON serializer of a
Throwable
.
Only the field "message" is serialized during the process.
- Since:
- 2.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(com.google.gson.JsonElement jsonElement, Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext) com.google.gson.JsonElement
-
Constructor Details
-
ThrowableJsonAdapter
public ThrowableJsonAdapter()
-
-
Method Details
-
serialize
public com.google.gson.JsonElement serialize(Throwable exception, Type type, com.google.gson.JsonSerializationContext jsonSerializationContext) - Specified by:
serialize
in interfacecom.google.gson.JsonSerializer<Throwable>
- Since:
- 2.0.0
-
deserialize
public Throwable deserialize(com.google.gson.JsonElement jsonElement, Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext) throws com.google.gson.JsonParseException - Specified by:
deserialize
in interfacecom.google.gson.JsonDeserializer<Throwable>
- Throws:
com.google.gson.JsonParseException
- Since:
- 2.3.2
-