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

Method get

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

Returns the last metadata entry added with the name 'name' parsed as T. @return the parsed metadata entry or null if there are none.

(Key<T> key)

Source from the content-addressed store, hash-verified

245 * @return the parsed metadata entry or null if there are none.
246 */
247 @Nullable
248 public <T> T get(Key<T> key) {
249 for (int i = size - 1; i >= 0; i--) {
250 if (bytesEqual(key.asciiName(), name(i))) {
251 return valueAsT(i, key);
252 }
253 }
254 return null;
255 }
256
257 private final class IterableAt<T> implements Iterable<T> {
258 private final Key<T> key;

Calls 4

bytesEqualMethod · 0.95
nameMethod · 0.95
valueAsTMethod · 0.95
asciiNameMethod · 0.80