-
Notifications
You must be signed in to change notification settings - Fork 355
Expand file tree
/
Copy pathTracerEnvironment.java
More file actions
232 lines (195 loc) · 4.98 KB
/
Copy pathTracerEnvironment.java
File metadata and controls
232 lines (195 loc) · 4.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
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
package datadog.trace.civisibility.config;
import com.squareup.moshi.Json;
import datadog.trace.api.civisibility.config.Configurations;
import java.util.HashMap;
import java.util.Map;
public class TracerEnvironment {
private final String service;
private final String env;
@Json(name = "repository_url")
private final String repositoryUrl;
private final String branch;
private final String sha;
@Json(name = "commit_message")
private final String commitMessage;
@Json(name = "test_level")
private final String testLevel = "test";
private final String module;
private final Configurations configurations;
private TracerEnvironment(
String service,
String env,
String repositoryUrl,
String branch,
String sha,
String commitMessage,
String module,
Configurations configurations) {
this.service = service;
this.env = env;
this.repositoryUrl = repositoryUrl;
this.branch = branch;
this.sha = sha;
this.commitMessage = commitMessage;
this.module = module;
this.configurations = configurations;
}
public String getSha() {
return sha;
}
public String getCommitMessage() {
return commitMessage;
}
public String getService() {
return service;
}
public String getEnv() {
return env;
}
public String getRepositoryUrl() {
return repositoryUrl;
}
public String getBranch() {
return branch;
}
public String getTestLevel() {
return testLevel;
}
public String getModule() {
return module;
}
public Configurations getConfigurations() {
return configurations;
}
@Override
public String toString() {
return "TracerEnvironment{"
+ "service='"
+ service
+ '\''
+ ", env='"
+ env
+ '\''
+ ", repositoryUrl='"
+ repositoryUrl
+ '\''
+ ", branch='"
+ branch
+ '\''
+ ", sha='"
+ sha
+ '\''
+ ", commitMessage='"
+ commitMessage
+ '\''
+ ", testLevel='"
+ testLevel
+ '\''
+ ", module='"
+ module
+ '\''
+ ", configurations="
+ configurations
+ '}';
}
public static Builder builder() {
return new Builder();
}
public static final class Builder {
private String service;
private String env;
private String repositoryUrl;
private String branch;
private String sha;
private String commitMessage;
private String osPlatform;
private String osArchitecture;
private String osVersion;
private String runtimeName;
private String runtimeVersion;
private String runtimeVendor;
private String runtimeArchitecture;
private String testBundle;
private final Map<String, String> customTags = new HashMap<>();
public Builder service(String service) {
this.service = service;
return this;
}
public Builder env(String env) {
this.env = env;
return this;
}
public Builder repositoryUrl(String repositoryUrl) {
this.repositoryUrl = repositoryUrl;
return this;
}
public Builder branch(String branch) {
this.branch = branch;
return this;
}
public Builder sha(String sha) {
this.sha = sha;
return this;
}
public Builder commitMessage(String commitMessage) {
this.commitMessage = commitMessage;
return this;
}
public Builder osPlatform(String osPlatform) {
this.osPlatform = osPlatform;
return this;
}
public Builder osArchitecture(String osArchitecture) {
this.osArchitecture = osArchitecture;
return this;
}
public Builder osVersion(String osVersion) {
this.osVersion = osVersion;
return this;
}
public Builder runtimeName(String runtimeName) {
this.runtimeName = runtimeName;
return this;
}
public Builder runtimeVersion(String runtimeVersion) {
this.runtimeVersion = runtimeVersion;
return this;
}
public Builder runtimeVendor(String runtimeVendor) {
this.runtimeVendor = runtimeVendor;
return this;
}
public Builder runtimeArchitecture(String runtimeArchitecture) {
this.runtimeArchitecture = runtimeArchitecture;
return this;
}
public Builder testBundle(String testBundle) {
this.testBundle = testBundle;
return this;
}
public Builder customTag(String key, String value) {
this.customTags.put(key, value);
return this;
}
public TracerEnvironment build() {
return new TracerEnvironment(
service,
env,
repositoryUrl,
branch,
sha,
commitMessage,
testBundle,
new Configurations(
osPlatform,
osArchitecture,
osVersion,
runtimeName,
runtimeVersion,
runtimeVendor,
runtimeArchitecture,
testBundle,
customTags));
}
}
}