Classes | Static Public Member Functions | Private Member Functions | Static Private Member Functions | List of all members
com.google.protobuf.RpcUtil Class Reference

Classes

class  AlreadyCalledException
 

Static Public Member Functions

static< Type extends Message > RpcCallback< MessagegeneralizeCallback (final RpcCallback< Type > originalCallback, final Class< Type > originalClass, final Type defaultInstance)
 
static< Type extends Message > RpcCallback< MessagegeneralizeCallback (final RpcCallback< Type > originalCallback, final Class< Type > originalClass, final Type defaultInstance)
 
static< ParameterType > RpcCallback< ParameterType > newOneTimeCallback (final RpcCallback< ParameterType > originalCallback)
 
static< ParameterType > RpcCallback< ParameterType > newOneTimeCallback (final RpcCallback< ParameterType > originalCallback)
 
static< Type extends Message > RpcCallback< TypespecializeCallback (final RpcCallback< Message > originalCallback)
 
static< Type extends Message > RpcCallback< TypespecializeCallback (final RpcCallback< Message > originalCallback)
 

Private Member Functions

 RpcUtil ()
 
 RpcUtil ()
 

Static Private Member Functions

static< Type extends Message > Type copyAsType (final Type typeDefaultInstance, final Message source)
 
static< Type extends Message > Type copyAsType (final Type typeDefaultInstance, final Message source)
 

Detailed Description

Grab-bag of utility functions useful when dealing with RPCs.

Author
kento.nosp@m.n@go.nosp@m.ogle..nosp@m.com Kenton Varda

Definition at line 38 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

Constructor & Destructor Documentation

◆ RpcUtil() [1/2]

com.google.protobuf.RpcUtil.RpcUtil ( )
inlineprivate

◆ RpcUtil() [2/2]

com.google.protobuf.RpcUtil.RpcUtil ( )
inlineprivate

Member Function Documentation

◆ copyAsType() [1/2]

static <Type extends Message> Type com.google.protobuf.RpcUtil.copyAsType ( final Type  typeDefaultInstance,
final Message  source 
)
inlinestaticprivate

Creates a new message of type "Type" which is a copy of "source". "source" must have the same descriptor but may be a different class (e.g. DynamicMessage).

Definition at line 89 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ copyAsType() [2/2]

static <Type extends Message> Type com.google.protobuf.RpcUtil.copyAsType ( final Type  typeDefaultInstance,
final Message  source 
)
inlinestaticprivate

Creates a new message of type "Type" which is a copy of "source". "source" must have the same descriptor but may be a different class (e.g. DynamicMessage).

Definition at line 89 of file protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ generalizeCallback() [1/2]

static <Type extends Message> RpcCallback<Message> com.google.protobuf.RpcUtil.generalizeCallback ( final RpcCallback< Type originalCallback,
final Class< Type originalClass,
final Type  defaultInstance 
)
inlinestatic

Take an

RpcCallback

accepting a specific message type and convert it to an

RpcCallback<Message>

. The generalized callback will accept any message object which has the same descriptor, and will convert it to the correct class before calling the original callback. However, if the generalized callback is given a message with a different descriptor, an exception will be thrown.

Definition at line 66 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ generalizeCallback() [2/2]

static <Type extends Message> RpcCallback<Message> com.google.protobuf.RpcUtil.generalizeCallback ( final RpcCallback< Type originalCallback,
final Class< Type originalClass,
final Type  defaultInstance 
)
inlinestatic

Take an

RpcCallback

accepting a specific message type and convert it to an

RpcCallback<Message>

. The generalized callback will accept any message object which has the same descriptor, and will convert it to the correct class before calling the original callback. However, if the generalized callback is given a message with a different descriptor, an exception will be thrown.

Definition at line 66 of file protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ newOneTimeCallback() [1/2]

static <ParameterType> RpcCallback<ParameterType> com.google.protobuf.RpcUtil.newOneTimeCallback ( final RpcCallback< ParameterType >  originalCallback)
inlinestatic

Creates a callback which can only be called once. This may be useful for security, when passing a callback to untrusted code: most callbacks do not expect to be called more than once, so doing so may expose bugs if it is not prevented.

Definition at line 99 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ newOneTimeCallback() [2/2]

static <ParameterType> RpcCallback<ParameterType> com.google.protobuf.RpcUtil.newOneTimeCallback ( final RpcCallback< ParameterType >  originalCallback)
inlinestatic

Creates a callback which can only be called once. This may be useful for security, when passing a callback to untrusted code: most callbacks do not expect to be called more than once, so doing so may expose bugs if it is not prevented.

Definition at line 99 of file protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ specializeCallback() [1/2]

static <Type extends Message> RpcCallback<Type> com.google.protobuf.RpcUtil.specializeCallback ( final RpcCallback< Message originalCallback)
inlinestatic

Take an

RpcCallback<Message>

and convert it to an

RpcCallback

accepting a specific message type. This is always type-safe (parameter type contravariance).

Definition at line 46 of file bloaty/third_party/protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.

◆ specializeCallback() [2/2]

static <Type extends Message> RpcCallback<Type> com.google.protobuf.RpcUtil.specializeCallback ( final RpcCallback< Message originalCallback)
inlinestatic

Take an

RpcCallback<Message>

and convert it to an

RpcCallback

accepting a specific message type. This is always type-safe (parameter type contravariance).

Definition at line 46 of file protobuf/java/core/src/main/java/com/google/protobuf/RpcUtil.java.


The documentation for this class was generated from the following file:


grpc
Author(s):
autogenerated on Fri May 16 2025 03:03:07