@Immutable public final class CallOptions extends Object
A field that is not set is null.
| Modifier and Type | Field and Description |
|---|---|
static CallOptions |
DEFAULT
A blank
CallOptions that all fields are not set. |
| Modifier and Type | Method and Description |
|---|---|
String |
getAuthority()
Override the HTTP/2 authority the channel claims to be connecting to.
|
Compressor |
getCompressor()
Returns the compressor, or
null if none is set. |
Long |
getDeadlineNanoTime()
Returns the deadline in nanoseconds in the clock as per
System.nanoTime(). |
String |
toString() |
CallOptions |
withAuthority(String authority)
Override the HTTP/2 authority the channel claims to be connecting to.
|
CallOptions |
withCompressor(Compressor compressor)
Use the desired compression.
|
CallOptions |
withDeadlineAfter(long duration,
TimeUnit unit)
Returns a new
CallOptions with a deadline that is after the given duration from
now. |
CallOptions |
withDeadlineNanoTime(Long deadlineNanoTime)
Returns a new
CallOptions with the given absolute deadline in nanoseconds in the clock
as per System.nanoTime(). |
public static final CallOptions DEFAULT
CallOptions that all fields are not set.@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/67") public CallOptions withAuthority(@Nullable String authority)
public CallOptions withDeadlineNanoTime(@Nullable Long deadlineNanoTime)
CallOptions with the given absolute deadline in nanoseconds in the clock
as per System.nanoTime().
This is mostly used for propagating an existing deadline. withDeadlineAfter(long, java.util.concurrent.TimeUnit) is the
recommended way of setting a new deadline,
deadlineNanoTime - the deadline in the clock as per System.nanoTime().
null for unsetting the deadline.public CallOptions withDeadlineAfter(long duration, TimeUnit unit)
CallOptions with a deadline that is after the given duration from
now.@Nullable public Long getDeadlineNanoTime()
System.nanoTime(). null
if the deadline is not set.@Nullable @ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/492") public Compressor getCompressor()
null if none is set.@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/492") public CallOptions withCompressor(@Nullable Compressor compressor)
@Nullable @ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/67") public String getAuthority()