Skip to content

Commit 90d5644

Browse files
committed
Support seq_id in ConfigSetting
1 parent 48d0e51 commit 90d5644

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

internal-api/src/main/java/datadog/trace/api/ConfigSetting.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,25 @@ public final class ConfigSetting {
1111
public final String key;
1212
public final Object value;
1313
public final ConfigOrigin origin;
14+
public final int seqId;
1415

1516
private static final Set<String> CONFIG_FILTER_LIST =
1617
new HashSet<>(
1718
Arrays.asList("DD_API_KEY", "dd.api-key", "dd.profiling.api-key", "dd.profiling.apikey"));
1819

1920
public static ConfigSetting of(String key, Object value, ConfigOrigin origin) {
20-
return new ConfigSetting(key, value, origin);
21+
return new ConfigSetting(key, value, origin, 0);
2122
}
2223

23-
private ConfigSetting(String key, Object value, ConfigOrigin origin) {
24+
public static ConfigSetting of(String key, Object value, ConfigOrigin origin, int seqId) {
25+
return new ConfigSetting(key, value, origin, seqId);
26+
}
27+
28+
private ConfigSetting(String key, Object value, ConfigOrigin origin, int seqId) {
2429
this.key = key;
2530
this.value = CONFIG_FILTER_LIST.contains(key) ? "<hidden>" : value;
2631
this.origin = origin;
32+
this.seqId = seqId;
2733
}
2834

2935
public String normalizedKey() {
@@ -99,12 +105,15 @@ public boolean equals(Object o) {
99105
if (this == o) return true;
100106
if (o == null || getClass() != o.getClass()) return false;
101107
ConfigSetting that = (ConfigSetting) o;
102-
return key.equals(that.key) && Objects.equals(value, that.value) && origin == that.origin;
108+
return key.equals(that.key)
109+
&& Objects.equals(value, that.value)
110+
&& origin == that.origin
111+
&& seqId == that.seqId;
103112
}
104113

105114
@Override
106115
public int hashCode() {
107-
return Objects.hash(key, value, origin);
116+
return Objects.hash(key, value, origin, seqId);
108117
}
109118

110119
@Override
@@ -117,6 +126,8 @@ public String toString() {
117126
+ stringValue()
118127
+ ", origin="
119128
+ origin
129+
+ ", seq_id="
130+
+ seqId
120131
+ '}';
121132
}
122133
}

0 commit comments

Comments
 (0)