|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.protobuf.RpcUtil
public final class RpcUtil
Grab-bag of utility functions useful when dealing with RPCs.
Nested Class Summary | |
---|---|
static class |
RpcUtil.AlreadyCalledException
Exception thrown when a one-time callback is called more than once. |
Method Summary | ||
---|---|---|
static
|
generalizeCallback(RpcCallback<Type> originalCallback,
java.lang.Class<Type> originalClass,
Type defaultInstance)
Take an RpcCallback accepting a specific message type and convert
it to an RpcCallback<Message> . |
|
static
|
newOneTimeCallback(RpcCallback<ParameterType> originalCallback)
Creates a callback which can only be called once. |
|
static
|
specializeCallback(RpcCallback<Message> originalCallback)
Take an RpcCallback<Message> and convert it to an
RpcCallback accepting a specific message type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <Type extends Message> RpcCallback<Type> specializeCallback(RpcCallback<Message> originalCallback)
RpcCallback<Message>
and convert it to an
RpcCallback
accepting a specific message type. This is always
type-safe (parameter type contravariance).
public static <Type extends Message> RpcCallback<Message> generalizeCallback(RpcCallback<Type> originalCallback, java.lang.Class<Type> originalClass, Type defaultInstance)
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.
public static <ParameterType> RpcCallback<ParameterType> newOneTimeCallback(RpcCallback<ParameterType> originalCallback)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |