CallOptions { @Override public String toString() { MoreObjects.ToStringHelper toStringHelper = MoreObjects.toStringHelper(this); toStringHelper.add("deadline", deadline); toStringHelper.add("authority", authority); toStringHelper.add("affinity", affinity); toStringHelper.add("executor", executor != null ? executor.getClass() : null); toStringHelper.add("compressorName", compressorName); return toStringHelper.toString(); } private  CallOptions(); private  CallOptions(CallOptions other); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") CallOptions withAuthority(@Nullable String authority); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") CallOptions withCompression(@Nullable String compressorName); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1706") CallOptions withDeadline(@Nullable Deadline deadline); @Deprecated CallOptions withDeadlineNanoTime(@Nullable Long deadlineNanoTime); CallOptions withDeadlineAfter(long duration, TimeUnit unit); @Deprecated Long getDeadlineNanoTime(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1706") @Nullable Deadline getDeadline(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766") CallOptions withAffinity(Attributes affinity); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1766") Attributes getAffinity(); @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1704") @Nullable String getCompressor(); @Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/1767") String getAuthority(); CallOptions withExecutor(Executor executor); @Nullable Executor getExecutor(); @Override String toString(); static final CallOptions DEFAULT; }
@Test public void toStringMatches_noDeadline() { assertThat("CallOptions{deadline=null, authority=null, " + "affinity={}, executor=null, compressorName=null}") .isEqualTo(CallOptions.DEFAULT.toString()); }
@Test public void toStringMatches_withDeadline() { allSet.toString().contains("1 ns from now"); }