MCPcopy Create free account
hub / github.com/grpc/grpc-java / put

Method put

api/src/main/java/io/grpc/Metadata.java:342–353  ·  view source on GitHub ↗

Adds the key, value pair. If key already has values, value is added to the end. Duplicate values for the same key are permitted. @throws NullPointerException if key or value is null

(Key<T> key, T value)

Source from the content-addressed store, hash-verified

340 * @throws NullPointerException if key or value is null
341 */
342 public <T> void put(Key<T> key, T value) {
343 Preconditions.checkNotNull(key, "key");
344 Preconditions.checkNotNull(value, "value");
345 maybeExpand();
346 name(size, key.asciiName());
347 if (key.serializesToStreams()) {
348 value(size, LazyValue.create(key, value));
349 } else {
350 value(size, key.toBytes(value));
351 }
352 size++;
353 }
354
355 private void maybeExpand() {
356 if (len() == 0 || len() == cap()) {

Calls 8

maybeExpandMethod · 0.95
nameMethod · 0.95
valueMethod · 0.95
createMethod · 0.95
checkNotNullMethod · 0.80
asciiNameMethod · 0.80
toBytesMethod · 0.65
serializesToStreamsMethod · 0.45