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

Method getArg

api/src/main/java/io/grpc/NameResolver.java:455–459  ·  view source on GitHub ↗

Returns the value of a custom arg named 'key', or null if it's not set. While ordinary Args should be universally useful and meaningful, custom arguments can apply just to resolvers of a certain URI scheme, just to resolvers producing a particular type of {@link java.net.SocketAd

(Key<T> key)

Source from the content-addressed store, hash-verified

453 * io.grpc package.
454 */
455 @SuppressWarnings("unchecked") // Cast is safe because all put()s go through the setArg() API.
456 @Nullable
457 public <T> T getArg(Key<T> key) {
458 return customArgs != null ? (T) customArgs.get(key) : null;
459 }
460
461 /**
462 * Returns the {@link ChannelLogger} for the Channel served by this NameResolver.

Callers 4

argsMethod · 0.80
IntentNameResolverMethod · 0.80
XdsNameResolverMethod · 0.80

Calls 1

getMethod · 0.65

Tested by 2

argsMethod · 0.64