public final class ServerStreamingMethodStubBuilderImpl<ReqT,RespT> extends Object implements ServerStreamingMethodStubBuilderStep<ReqT,RespT>, NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>
| Constructor and Description |
|---|
ServerStreamingMethodStubBuilderImpl(io.grpc.MethodDescriptor<ReqT,RespT> method) |
| Modifier and Type | Method and Description |
|---|---|
MethodStub<ReqT,RespT> |
build() |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillProxyTo(BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given
Response for
subsequent request call to this stub. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillReturn(ExceptionResponseActionBuilder response)
Defines a exception
Response for subsequent request call to this stub. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillReturn(ObjectResponseActionBuilder<RespT> response)
Defines a single
Response for subsequent request call to this stub. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
nextWillReturn(StreamResponseBuilder<RespT> response)
Defines a stream
Response for subsequent request call that will execute multiple
ResponseAction. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
willProxyTo(BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
Defines a proxying response, which will proxy the request to given
Response. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
willReturn(ExceptionResponseActionBuilder response)
Defines a exception
Response that will terminate the request. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
willReturn(ObjectResponseActionBuilder<RespT> response)
Defines a single
Response that will be returned for the request and complete it. |
NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> |
willReturn(StreamResponseBuilder<RespT> response)
Defines a stream
Response that will execute multiple ResponseAction. |
<T> ServerStreamingMethodStubBuilderStep<ReqT,RespT> |
withHeader(io.grpc.Metadata.Key<T> headerKey,
Predicate<T> predicate)
Adds a header matcher for the stub, which will trigger only if the given header
has value satisfying given
Predicate. |
ServerStreamingMethodStubBuilderStep<ReqT,RespT> |
withRequest(Predicate<ReqT> requestPredicate)
Adds a request matcher for the stub, which will trigger only if incoming request
satisfies given
Predicate. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwithHeader, withHeader, withHeader, withHeader, withoutHeader, withoutHeaderwithRequestwillReturn, willReturnwillReturn, willReturnwillReturnnextWillReturn, nextWillReturnnextWillReturn, nextWillReturnnextWillReturnpublic <T> ServerStreamingMethodStubBuilderStep<ReqT,RespT> withHeader(@Nonnull io.grpc.Metadata.Key<T> headerKey, @Nonnull Predicate<T> predicate)
HeadersMatcherBuilderStepAdds a header matcher for the stub, which will trigger only if the given header
has value satisfying given Predicate.
Subsequent matchers for the same header will replace the old one.
withHeader in interface HeadersMatcherBuilderStep<ServerStreamingMethodStubBuilderStep<ReqT,RespT>>public ServerStreamingMethodStubBuilderStep<ReqT,RespT> withRequest(@Nonnull Predicate<ReqT> requestPredicate)
RequestMatcherBuilderStepAdds a request matcher for the stub, which will trigger only if incoming request
satisfies given Predicate.
Only applicable to unary or server streaming methods.
Subsequent request matchers will replace the old one.
withRequest in interface RequestMatcherBuilderStep<ServerStreamingMethodStubBuilderStep<ReqT,RespT>,ReqT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> willReturn(@Nonnull ObjectResponseActionBuilder<RespT> response)
SingleResponseBuilderStepResponse that will be returned for the request and complete it.willReturn in interface SingleResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> willReturn(@Nonnull ExceptionResponseActionBuilder response)
SingleResponseBuilderStepResponse that will terminate the request.willReturn in interface SingleResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> willReturn(@Nonnull StreamResponseBuilder<RespT> response)
StreamResponseBuilderStepResponse that will execute multiple ResponseAction.willReturn in interface StreamResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillReturn(@Nonnull StreamResponseBuilder<RespT> response)
NextStreamResponseBuilderStepDefines a stream Response for subsequent request call that will execute multiple
ResponseAction.
If there are more requests coming in to this stub than responses defined, the last stream response defined will be returned for those requests.
nextWillReturn in interface NextStreamResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillReturn(@Nonnull ObjectResponseActionBuilder<RespT> response)
NextSingleResponseBuilderStepDefines a single Response for subsequent request call to this stub.
If there are more requests coming in to this stub than responses defined, the last response defined will be returned for those requests.
nextWillReturn in interface NextSingleResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillReturn(@Nonnull ExceptionResponseActionBuilder response)
NextSingleResponseBuilderStepDefines a exception Response for subsequent request call to this stub.
If there are more requests coming in to this stub than responses defined, the last response defined will be returned for those requests.
nextWillReturn in interface NextSingleResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> willProxyTo(@Nonnull BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
SingleRequestProxyResponseBuilderStepDefines a proxying response, which will proxy the request to given Response. The
user is responsible that the request is completed correctly.
Should be used when there needs to be more logic in the response method than returning a
simple response.
For example:
.willProxyTo((request, responseObserver) -> {
responseObserver.onNext(responseObject);
responseObserver.onCompleted();
});
willProxyTo in interface SingleRequestProxyResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public NextServerStreamingMethodResponseBuilderStep<ReqT,RespT> nextWillProxyTo(@Nonnull BiConsumer<ReqT,io.grpc.stub.StreamObserver<RespT>> responseProxy)
NextSingleRequestProxyResponseBuilderStepDefines a proxying response, which will proxy the request to given Response for
subsequent request call to this stub. The user is responsible that the request is completed correctly.
Should be used when there needs to be more logic in the response method than returning a
simple response.
For example:
.nextWillProxyTo((request, responseObserver) -> {
responseObserver.onNext(responseObject);
responseObserver.onCompleted();
});
nextWillProxyTo in interface NextSingleRequestProxyResponseBuilderStep<NextServerStreamingMethodResponseBuilderStep<ReqT,RespT>,ReqT,RespT>public MethodStub<ReqT,RespT> build()
build in interface MethodStubBuilder<ReqT,RespT>Copyright © 2023. All rights reserved.