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 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 interface com.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 interface com.google.gson.JsonDeserializer<Throwable>
      Throws:
      com.google.gson.JsonParseException
      Since:
      2.3.2