@Test public void withCustomOptionDefault() { CallOptions opts = CallOptions.DEFAULT; assertThat(opts.getOption(OPTION_1)).isEqualTo("default"); }
@ExperimentalApi("https: @SuppressWarnings("unchecked") public <T> T getOption(Key<T> key) { Preconditions.checkNotNull(key, "key"); for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { return (T) customOptions[i][1]; } } return key.defaultValue; }
CallOptions { @ExperimentalApi("https: @SuppressWarnings("unchecked") public <T> T getOption(Key<T> key) { Preconditions.checkNotNull(key, "key"); for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { return (T) customOptions[i][1]; } } return key.defaultValue; } }
CallOptions { @ExperimentalApi("https: @SuppressWarnings("unchecked") public <T> T getOption(Key<T> key) { Preconditions.checkNotNull(key, "key"); for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { return (T) customOptions[i][1]; } } return key.defaultValue; } private  CallOptions(); private  CallOptions(CallOptions other); }
CallOptions { @ExperimentalApi("https: @SuppressWarnings("unchecked") public <T> T getOption(Key<T> key) { Preconditions.checkNotNull(key, "key"); for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { return (T) customOptions[i][1]; } } return key.defaultValue; } private  CallOptions(); private  CallOptions(CallOptions other); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") CallOptions withAuthority(@Nullable String authority); CallOptions withCallCredentials(@Nullable CallCredentials credentials); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") CallOptions withCompression(@Nullable String compressorName); CallOptions withDeadline(@Nullable Deadline deadline); CallOptions withDeadlineAfter(long duration, TimeUnit unit); @Nullable Deadline getDeadline(); CallOptions withWaitForReady(); CallOptions withoutWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") @Nullable String getCompressor(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") String getAuthority(); @Nullable CallCredentials getCredentials(); CallOptions withExecutor(Executor executor); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") CallOptions withStreamTracerFactory(ClientStreamTracer.Factory factory); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") List<ClientStreamTracer.Factory> getStreamTracerFactories(); CallOptions withOption(Key<T> key, T value); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869") @SuppressWarnings("unchecked") T getOption(Key<T> key); @Nullable Executor getExecutor(); boolean isWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxInboundMessageSize(int maxSize); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxOutboundMessageSize(int maxSize); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxInboundMessageSize(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxOutboundMessageSize(); @Override String toString(); }
CallOptions { @ExperimentalApi("https: @SuppressWarnings("unchecked") public <T> T getOption(Key<T> key) { Preconditions.checkNotNull(key, "key"); for (int i = 0; i < customOptions.length; i++) { if (key.equals(customOptions[i][0])) { return (T) customOptions[i][1]; } } return key.defaultValue; } private  CallOptions(); private  CallOptions(CallOptions other); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") CallOptions withAuthority(@Nullable String authority); CallOptions withCallCredentials(@Nullable CallCredentials credentials); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") CallOptions withCompression(@Nullable String compressorName); CallOptions withDeadline(@Nullable Deadline deadline); CallOptions withDeadlineAfter(long duration, TimeUnit unit); @Nullable Deadline getDeadline(); CallOptions withWaitForReady(); CallOptions withoutWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") @Nullable String getCompressor(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") String getAuthority(); @Nullable CallCredentials getCredentials(); CallOptions withExecutor(Executor executor); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") CallOptions withStreamTracerFactory(ClientStreamTracer.Factory factory); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2861") List<ClientStreamTracer.Factory> getStreamTracerFactories(); CallOptions withOption(Key<T> key, T value); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869") @SuppressWarnings("unchecked") T getOption(Key<T> key); @Nullable Executor getExecutor(); boolean isWaitForReady(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxInboundMessageSize(int maxSize); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") CallOptions withMaxOutboundMessageSize(int maxSize); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxInboundMessageSize(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2563") Integer getMaxOutboundMessageSize(); @Override String toString(); static final CallOptions DEFAULT; }