-
-
Notifications
You must be signed in to change notification settings - Fork 467
Expand file tree
/
Copy pathSentryAttribute.java
More file actions
69 lines (55 loc) · 1.98 KB
/
SentryAttribute.java
File metadata and controls
69 lines (55 loc) · 1.98 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package io.sentry;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public final class SentryAttribute {
private final @NotNull String name;
private final @Nullable SentryAttributeType type;
private final @Nullable Object value;
private final int flattenDepth;
private SentryAttribute(
final @NotNull String name,
final @Nullable SentryAttributeType type,
final @Nullable Object value,
final int flattenDepth) {
this.name = name;
this.type = type;
this.value = value;
this.flattenDepth = flattenDepth;
}
public @NotNull String getName() {
return name;
}
public @Nullable SentryAttributeType getType() {
return type;
}
public @Nullable Object getValue() {
return value;
}
public int getFlattenDepth() {
return flattenDepth;
}
public static @NotNull SentryAttribute named(
final @NotNull String name, final @Nullable Object value) {
return new SentryAttribute(name, null, value, 0);
}
public static @NotNull SentryAttribute flattened(
final @NotNull String name, final @Nullable Object value) {
return new SentryAttribute(name, null, value, 1);
}
public static @NotNull SentryAttribute booleanAttribute(
final @NotNull String name, final @Nullable Boolean value) {
return new SentryAttribute(name, SentryAttributeType.BOOLEAN, value, 0);
}
public static @NotNull SentryAttribute integerAttribute(
final @NotNull String name, final @Nullable Integer value) {
return new SentryAttribute(name, SentryAttributeType.INTEGER, value, 0);
}
public static @NotNull SentryAttribute doubleAttribute(
final @NotNull String name, final @Nullable Double value) {
return new SentryAttribute(name, SentryAttributeType.DOUBLE, value, 0);
}
public static @NotNull SentryAttribute stringAttribute(
final @NotNull String name, final @Nullable String value) {
return new SentryAttribute(name, SentryAttributeType.STRING, value, 0);
}
}