forked from getsentry/sentry-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
120 lines (97 loc) · 2.93 KB
/
App.java
File metadata and controls
120 lines (97 loc) · 2.93 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
package io.sentry.protocol;
import io.sentry.IUnknownPropertiesConsumer;
import io.sentry.util.CollectionUtils;
import java.util.Date;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;
public final class App implements IUnknownPropertiesConsumer, Cloneable {
public static final String TYPE = "app";
/** Version-independent application identifier, often a dotted bundle ID. */
private String appIdentifier;
/**
* Start time of the app.
*
* <p>Formatted UTC timestamp when the user started the application.
*/
private Date appStartTime;
/** Application-specific device identifier. */
private String deviceAppHash;
/** String identifying the kind of build. For example, `testflight`. */
private String buildType;
/** Application name as it appears on the platform. */
private String appName;
/** Application version as it appears on the platform. */
private String appVersion;
/** Internal build ID as it appears on the platform. */
private String appBuild;
@SuppressWarnings("unused")
private Map<String, Object> unknown;
public String getAppIdentifier() {
return appIdentifier;
}
public void setAppIdentifier(String appIdentifier) {
this.appIdentifier = appIdentifier;
}
@SuppressWarnings("JdkObsolete")
public Date getAppStartTime() {
final Date appStartTimeRef = appStartTime;
return appStartTimeRef != null ? (Date) appStartTimeRef.clone() : null;
}
public void setAppStartTime(Date appStartTime) {
this.appStartTime = appStartTime;
}
public String getDeviceAppHash() {
return deviceAppHash;
}
public void setDeviceAppHash(String deviceAppHash) {
this.deviceAppHash = deviceAppHash;
}
public String getBuildType() {
return buildType;
}
public void setBuildType(String buildType) {
this.buildType = buildType;
}
public String getAppName() {
return appName;
}
public void setAppName(String appName) {
this.appName = appName;
}
public String getAppVersion() {
return appVersion;
}
public void setAppVersion(String appVersion) {
this.appVersion = appVersion;
}
public String getAppBuild() {
return appBuild;
}
public void setAppBuild(String appBuild) {
this.appBuild = appBuild;
}
@TestOnly
Map<String, Object> getUnknown() {
return unknown;
}
@ApiStatus.Internal
@Override
public void acceptUnknownProperties(Map<String, Object> unknown) {
this.unknown = new ConcurrentHashMap<>(unknown);
}
/**
* Clones an App aka deep copy
*
* @return the cloned App
* @throws CloneNotSupportedException if object is not cloneable
*/
@Override
public @NotNull App clone() throws CloneNotSupportedException {
final App clone = (App) super.clone();
clone.unknown = CollectionUtils.shallowCopy(unknown);
return clone;
}
}