MCPcopy Index your code
hub / github.com/grpc/grpc-java / containsKey

Method containsKey

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

Returns true if a value is defined for the given key. This is done by linear search, so if it is followed by #get or #getAll, prefer calling them directly and checking the return value against null.

(Key<?> key)

Source from the content-addressed store, hash-verified

231 * prefer calling them directly and checking the return value against {@code null}.
232 */
233 public boolean containsKey(Key<?> key) {
234 for (int i = 0; i < size; i++) {
235 if (bytesEqual(key.asciiName(), name(i))) {
236 return true;
237 }
238 }
239 return false;
240 }
241
242 /**
243 * Returns the last metadata entry added with the name 'name' parsed as T.

Calls 3

bytesEqualMethod · 0.95
nameMethod · 0.95
asciiNameMethod · 0.80