Skip to content

Commit

Permalink
Rename Setter.put to Setter.set (#769)
Browse files Browse the repository at this point in the history
Improving consistency and cohesion of naming.
  • Loading branch information
tylerbenson authored and bogdandrutu committed Jan 17, 2020
1 parent ba17e1f commit 7b601b1
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ interface Setter<C> {
* @param value the value of the field.
* @since 0.1.0
*/
void put(C carrier, String key, String value);
void set(C carrier, String key, String value);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public <C> void inject(SpanContext spanContext, C carrier, Setter<C> setter) {
spanContext.getSpanId().copyLowerBase16To(chars, SPAN_ID_OFFSET);
chars[TRACE_OPTION_OFFSET - 1] = TRACEPARENT_DELIMITER;
spanContext.getTraceFlags().copyLowerBase16To(chars, TRACE_OPTION_OFFSET);
setter.put(carrier, TRACEPARENT, new String(chars));
setter.set(carrier, TRACEPARENT, new String(chars));
List<Tracestate.Entry> entries = spanContext.getTracestate().getEntries();
if (entries.isEmpty()) {
// No need to add an empty "tracestate" header.
Expand All @@ -98,7 +98,7 @@ public <C> void inject(SpanContext spanContext, C carrier, Setter<C> setter) {
.append(TRACESTATE_KEY_VALUE_DELIMITER)
.append(entry.getValue());
}
setter.put(carrier, TRACESTATE, stringBuilder.toString());
setter.set(carrier, TRACESTATE, stringBuilder.toString());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class HttpTraceContextTest {
private static final Setter<Map<String, String>> setter =
new Setter<Map<String, String>>() {
@Override
public void put(Map<String, String> carrier, String key, String value) {
public void set(Map<String, String> carrier, String key, String value) {
carrier.put(key, value);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private TextMapSetter() {}
public static final TextMapSetter INSTANCE = new TextMapSetter();

@Override
public void put(TextMapInject carrier, String key, String value) {
public void set(TextMapInject carrier, String key, String value) {
carrier.put(key, value);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void send() throws InterruptedException {
message,
new Setter<Message>() {
@Override
public void put(Message carrier, String key, String value) {
public void set(Message carrier, String key, String value) {
carrier.put(key, value);
}
});
Expand Down

0 comments on commit 7b601b1

Please sign in to comment.