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

Method keys

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

Returns set of all keys in store. @return unmodifiable Set of keys

()

Source from the content-addressed store, hash-verified

321 * @return unmodifiable Set of keys
322 */
323 @SuppressWarnings("deprecation") // The String ctor is deprecated, but fast.
324 public Set<String> keys() {
325 if (isEmpty()) {
326 return Collections.emptySet();
327 }
328 Set<String> ks = Sets.newHashSetWithExpectedSize(size);
329 for (int i = 0; i < size; i++) {
330 ks.add(new String(name(i), 0 /* hibyte */));
331 }
332 // immutable in case we decide to change the implementation later.
333 return Collections.unmodifiableSet(ks);
334 }
335
336 /**
337 * Adds the {@code key, value} pair. If {@code key} already has values, {@code value} is added to

Calls 3

isEmptyMethod · 0.95
nameMethod · 0.95
addMethod · 0.65