-
-
Notifications
You must be signed in to change notification settings - Fork 468
Expand file tree
/
Copy pathISerializer.java
More file actions
38 lines (30 loc) · 1.06 KB
/
ISerializer.java
File metadata and controls
38 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package io.sentry;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface ISerializer {
<T, R> @Nullable T deserializeCollection(
@NotNull Reader reader,
@NotNull Class<T> clazz,
@Nullable JsonDeserializer<R> elementDeserializer);
<T> @Nullable T deserialize(@NotNull Reader reader, @NotNull Class<T> clazz);
@Nullable
SentryEnvelope deserializeEnvelope(@NotNull InputStream inputStream);
<T> void serialize(@NotNull T entity, @NotNull Writer writer) throws IOException;
/**
* Serializes an envelope
*
* @param envelope an envelope
* @param outputStream which will not be closed automatically
* @throws Exception an exception
*/
void serialize(@NotNull SentryEnvelope envelope, @NotNull OutputStream outputStream)
throws Exception;
@NotNull
String serialize(@NotNull Map<String, Object> data) throws Exception;
}