Package io.grpc
Class CallOptions.Key<T>
java.lang.Object
io.grpc.CallOptions.Key<T>
- Enclosing class:
CallOptions
Key for a key-value pair. Uses reference equality.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CallOptions.Key
<T> Factory method for creating instances ofCallOptions.Key
.static <T> CallOptions.Key
<T> createWithDefault
(String debugString, T defaultValue) Factory method for creating instances ofCallOptions.Key
.Returns the user supplied default value for this key.static <T> CallOptions.Key
<T> Deprecated.toString()
-
Method Details
-
getDefault
Returns the user supplied default value for this key. -
toString
-
of
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1869") @Deprecated public static <T> CallOptions.Key<T> of(String debugString, T defaultValue) Deprecated.Usecreate(java.lang.String)
orcreateWithDefault(java.lang.String, T)
instead. This method will be removed.Factory method for creating instances ofCallOptions.Key
.- Type Parameters:
T
- Key type- Parameters:
debugString
- a string used to describe this key, used for debugging.defaultValue
- default value to return when value for key not set- Returns:
- Key object
-
create
Factory method for creating instances ofCallOptions.Key
. The default value of the key isnull
.- Type Parameters:
T
- Key type- Parameters:
debugString
- a debug string that describes this key.- Returns:
- Key object
- Since:
- 1.13.0
-
createWithDefault
Factory method for creating instances ofCallOptions.Key
.- Type Parameters:
T
- Key type- Parameters:
debugString
- a debug string that describes this key.defaultValue
- default value to return when value for key not set- Returns:
- Key object
- Since:
- 1.13.0
-
create(java.lang.String)
orcreateWithDefault(java.lang.String, T)
instead.