Package dev.restate.common
Interface Request<Req,Res>
- Type Parameters:
Req
- the request typeRes
- the response type
- All Known Subinterfaces:
RequestBuilder<Req,
,Res> WorkflowRequest<Req,
,Res> WorkflowRequestBuilder<Req,
Res>
public interface Request<Req,Res>
Interface encapsulating request parameters.
-
Method Summary
Modifier and TypeMethodDescription@Nullable String
static RequestBuilder
<byte[], byte[]> static <Req,
Res> RequestBuilder <Req, Res>
-
Method Details
-
of
static <Req,Res> RequestBuilder<Req,Res> of(Target target, TypeTag<Req> reqTypeTag, TypeTag<Res> resTypeTag, Req request) Create a newRequestBuilder
for the givenTarget
, request and responseTypeTag
andrequest
object.When using the annotation processor, you can rely on the generated
Handlers
class, instead of manually using this builder. For example, for a service class nameGreeter
, the corresponding class where all the requests builders are available is namedGreeterHandlers
-
of
Create a newRequestBuilder
for the givenTarget
andrequest
byte array.When using the annotation processor, you can rely on the generated
Handlers
class, instead of manually using this builder. For example, for a service class nameGreeter
, the corresponding class where all the requests builders are available is namedGreeterHandlers
-
getTarget
Target getTarget()- Returns:
- the request target
-
getRequestTypeTag
- Returns:
- the request type tag
-
getResponseTypeTag
- Returns:
- the response type tag
-
getRequest
Req getRequest()- Returns:
- the request object
-
getIdempotencyKey
@Nullable String getIdempotencyKey()- Returns:
- the idempotency key
-
getHeaders
- Returns:
- the request headers
-