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

Method getOption

api/src/main/java/io/grpc/CallOptions.java:431–441  ·  view source on GitHub ↗

Get the value for a custom option or its inherent default. @param key Key identifying option

(Key<T> key)

Source from the content-addressed store, hash-verified

429 * @param key Key identifying option
430 */
431 @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869")
432 @SuppressWarnings("unchecked")
433 public <T> T getOption(Key<T> key) {
434 Preconditions.checkNotNull(key, "key");
435 for (int i = 0; i < customOptions.length; i++) {
436 if (key.equals(customOptions[i][0])) {
437 return (T) customOptions[i][1];
438 }
439 }
440 return key.defaultValue;
441 }
442
443 /**
444 * Returns the executor override to use for this specific call, or {@code null} if there is no

Calls 2

checkNotNullMethod · 0.80
equalsMethod · 0.45