public final class GsonSerializer extends java.lang.Object implements ISerializer
Constructor and Description |
---|
GsonSerializer(@NotNull ILogger logger,
@NotNull IEnvelopeReader envelopeReader)
AndroidSerializer ctor
|
Modifier and Type | Method and Description |
---|---|
@Nullable SentryEnvelope |
deserializeEnvelope(@NotNull java.io.InputStream inputStream)
Deserialize a SentryEnvelope from a InputStream (Envelope+JSON)
|
@Nullable SentryEvent |
deserializeEvent(@NotNull java.io.Reader reader)
Deserialize a SentryEvent from a stream Reader (JSON)
|
@Nullable Session |
deserializeSession(@NotNull java.io.Reader reader)
Deserialize a Session from a stream Reader (JSON)
|
void |
serialize(@NotNull SentryEnvelope envelope,
@NotNull java.io.Writer writer)
Serialize a SentryEnvelope to a stream Writer (JSON)
|
void |
serialize(@NotNull SentryEvent event,
@NotNull java.io.Writer writer)
Serialize a SentryEvent to a stream Writer (JSON)
|
void |
serialize(@NotNull Session session,
@NotNull java.io.Writer writer)
Serialize a Session to a stream Writer (JSON)
|
public GsonSerializer(@NotNull @NotNull ILogger logger, @NotNull @NotNull IEnvelopeReader envelopeReader)
logger
- the ILogger interfaceenvelopeReader
- the IEnvelopeReader interface@Nullable public @Nullable SentryEvent deserializeEvent(@NotNull @NotNull java.io.Reader reader)
deserializeEvent
in interface ISerializer
reader
- the Reader@Nullable public @Nullable Session deserializeSession(@NotNull @NotNull java.io.Reader reader)
deserializeSession
in interface ISerializer
reader
- the Reader@Nullable public @Nullable SentryEnvelope deserializeEnvelope(@NotNull @NotNull java.io.InputStream inputStream)
deserializeEnvelope
in interface ISerializer
inputStream
- the InputStreampublic void serialize(@NotNull @NotNull SentryEvent event, @NotNull @NotNull java.io.Writer writer) throws java.io.IOException
serialize
in interface ISerializer
event
- the SentryEventwriter
- the Writerjava.io.IOException
- an IOExceptionpublic void serialize(@NotNull @NotNull Session session, @NotNull @NotNull java.io.Writer writer) throws java.io.IOException
serialize
in interface ISerializer
session
- the Sessionwriter
- the Writerjava.io.IOException
- an IOExceptionpublic void serialize(@NotNull @NotNull SentryEnvelope envelope, @NotNull @NotNull java.io.Writer writer) throws java.lang.Exception
serialize
in interface ISerializer
envelope
- the SentryEnvelopewriter
- the Writerjava.io.IOException
- an IOExceptionjava.lang.Exception