Package dev.adlin.vts4j.request
Class RequestBuilder
java.lang.Object
dev.adlin.vts4j.request.RequestBuilder
-
Method Summary
Modifier and TypeMethodDescription@NotNull Requestbuild()Builds and returns a new Request object with the configured parameters.static @NotNull RequestBuilderof(@NotNull RequestType requestType) static @NotNull RequestBuilder@NotNull RequestBuildersetApiName(@NotNull String apiName) Sets the name of the API for the request.@NotNull RequestBuildersetApiVersion(@NotNull String apiVersion) Sets the version of the API for the request.@NotNull RequestBuildersetPayload(@NotNull com.google.gson.JsonObject payload) Sets payload required for certain types of requests.@NotNull RequestBuildersetRequestId(@NotNull String requestId) Sets the unique identifier for the request.
-
Method Details
-
of
-
of
-
setApiName
Sets the name of the API for the request.- Parameters:
apiName- The name of the API. Cannot be null.- Returns:
- This Builder instance to allow method chaining.
-
setApiVersion
Sets the version of the API for the request.- Parameters:
apiVersion- The version of the API. Cannot be null.- Returns:
- This Builder instance to allow method chaining.
-
setRequestId
Sets the unique identifier for the request.- Parameters:
requestId- The unique identifier for the request. Cannot be null.- Returns:
- This Builder instance to allow method chaining.
-
setPayload
@NotNull public @NotNull RequestBuilder setPayload(@NotNull @NotNull com.google.gson.JsonObject payload) Sets payload required for certain types of requests. More details about the payload structure can be found at this page.- Parameters:
payload- Additional information required for certain types of requests- Returns:
- This Builder instance to allow method chaining
-
build
Builds and returns a new Request object with the configured parameters. If messageType is not set, an IllegalArgumentException is thrown.- Returns:
- A new Request object with the configured parameters.
- Throws:
IllegalArgumentException- If messageType is null.
-