.append(entry.getKey()) .append(TRACESTATE_KEY_VALUE_DELIMITER) .append(entry.getValue());
.append(entry.getKey()) .append(TRACESTATE_KEY_VALUE_DELIMITER) .append(entry.getValue());
/** * Returns the value to which the specified key is mapped, or null if this map contains no mapping * for the key. * * @param key with which the specified value is to be associated * @return the value to which the specified key is mapped, or null if this map contains no mapping * for the key. * @since 0.16 */ @javax.annotation.Nullable public String get(String key) { for (Entry entry : getEntries()) { if (entry.getKey().equals(key)) { return entry.getValue(); } } return null; }
private static List<Entry> toEntriesProto(List<io.opencensus.trace.Tracestate.Entry> entries) { List<Entry> entriesProto = new ArrayList<Entry>(); for (io.opencensus.trace.Tracestate.Entry entry : entries) { entriesProto.add( Entry.newBuilder().setKey(entry.getKey()).setValue(entry.getValue()).build()); } return entriesProto; }