T - A placeholder for the type expected in the response, avoiding the requirement to cast responses. This is not
linked to the Type set on a request so a ClassCastException is possible if the type is set
incorrectly.public abstract class AbstractServiceRequest<T> extends Object
This is the superclass for read and write request classes, providing the functionality common to both. It is only intended for use internally so has a package private constructor.
Requests are split into read requests (including searches) and write requests because write requests can be included in multimessages and read requests cannot, and because read requests can be cached and write requests cannot.
| Modifier and Type | Method and Description |
|---|---|
Method |
getMethod()
The HTTP method of the request.
|
Map<String,String> |
getParams()
Querystring parameters to be added to the URL.
|
String |
getPath()
Returns the path of the Brightpearl resource within the service given by
getService(). |
Type |
getResponseType()
A generic type token representing the expected type of the response element in the JSON response body.
|
String |
getRuid()
A unique identifier for the request.
|
ServiceName |
getService()
Returns the name of the Brightpearl service that contains the resource to be called.
|
public String getRuid()
public Method getMethod()
public ServiceName getService()
public String getPath()
getService(). For example, for
the product GET API, this would be '/product'.public Type getResponseType()
Type is used instead of Class to provide support for deserialising
generic types e.g. collections and maps, however this does mean the type is not guaranteed to match the type token
T, which is used to avoid casting responses.Copyright © 2014. All Rights Reserved.