forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSentryItemType.java
More file actions
36 lines (30 loc) · 876 Bytes
/
SentryItemType.java
File metadata and controls
36 lines (30 loc) · 876 Bytes
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
package io.sentry;
import io.sentry.protocol.SentryTransaction;
import org.jetbrains.annotations.ApiStatus;
@ApiStatus.Internal
public enum SentryItemType {
Session("session"),
Event("event"), // DataCategory.Error
UserFeedback("user_report"), // Sentry backend still uses user_report
Attachment("attachment"),
Transaction("transaction"),
Unknown("__unknown__"); // DataCategory.Unknown
private final String itemType;
public static SentryItemType resolve(Object item) {
if (item instanceof SentryEvent) {
return Event;
} else if (item instanceof SentryTransaction) {
return Transaction;
} else if (item instanceof Session) {
return Session;
} else {
return Attachment;
}
}
SentryItemType(final String itemType) {
this.itemType = itemType;
}
public String getItemType() {
return itemType;
}
}