T - placeholder for the response type, used to avoid casting of responses. This is not
linked to the Type set on each request so a ClassCastException is possible if the type is set
incorrectly.public class ServiceReadRequestSetBuilder<T> extends Object
ServiceReadRequestSet instances. These requests are used to load large sets of data
easily, by creating individual ServiceReadRequests to the same API each with a subset of a large ID set.
This class is returned from static request builder methods in the services package, and provides a simple method for setting parameters on all the requests before they are built.
This builder does not attempt to check that all requests added are to the same API.
| Constructor and Description |
|---|
ServiceReadRequestSetBuilder() |
| Modifier and Type | Method and Description |
|---|---|
ServiceReadRequestSet<T> |
build()
Builds an immutable request set instance from values provided to this builder.
|
static <T> ServiceReadRequestSetBuilder<T> |
newReadRequestSet()
Creates a new paged GET request builder configured with the URL to call and expected response type.
|
static <T> ServiceReadRequestSetBuilder<T> |
newReadRequestSet(Class<T> responseType)
Creates a new paged GET request builder configured with the URL to call and expected response type.
|
ServiceReadRequestSetBuilder<T> |
withAddedParam(String name,
String value)
Add an additional unencoded querystring parameter to be added to every request, preserving the existing set but
overwriting any param with the same name.
|
ServiceReadRequestSetBuilder<T> |
withAddedParams(Map<String,String> params)
Add additional unencoded querystring parameters to be added to every request, preserving the existing set but
overwriting any param with the same names.
|
ServiceReadRequestSetBuilder<T> |
withAddedRequest(ServiceReadRequest<T> request)
Adds a request to the batch.
|
ServiceReadRequestSetBuilder<T> |
withAddedRequest(ServiceReadRequestBuilder<T> requestBuilder)
Adds a request to the batch.
|
ServiceReadRequestSetBuilder<T> |
withAddedRequests(Set<ServiceReadRequest<T>> requests)
Adds a set of requests to the batch.
|
ServiceReadRequestSetBuilder<T> |
withParams(Map<String,String> params)
Add querystring parameters to every request, replacing any previously set.
|
public static <T> ServiceReadRequestSetBuilder<T> newReadRequestSet(Class<T> responseType)
T - placeholder for the response type, used to avoid casting of responses.responseType - type of result expected in the 'response' element of the JSON response body. This argument is not used for parsing, only to providepublic static <T> ServiceReadRequestSetBuilder<T> newReadRequestSet()
T - placeholder for the response type, used to avoid casting of responses.public ServiceReadRequestSetBuilder<T> withAddedParam(String name, String value)
build() is called,
so includes those not yet added.name - parameter name.value - parameter value.public ServiceReadRequestSetBuilder<T> withAddedParams(Map<String,String> params)
build() is called,
so includes those not yet added.params - map of querystring params.public ServiceReadRequestSetBuilder<T> withParams(Map<String,String> params)
build() is called, so includes those not yet added.params - map of querystring params.public ServiceReadRequestSetBuilder<T> withAddedRequest(ServiceReadRequestBuilder<T> requestBuilder)
ServiceReadRequestBuilder.build() method.requestBuilder - A request to be added to the batch.public ServiceReadRequestSetBuilder<T> withAddedRequest(ServiceReadRequest<T> request)
request - A request to be added to the batch.public ServiceReadRequestSetBuilder<T> withAddedRequests(Set<ServiceReadRequest<T>> requests)
requests - Requests to be added to the batch.public ServiceReadRequestSet<T> build()
Copyright © 2014. All Rights Reserved.