public class RequestHelper extends Object
Constructor and Description |
---|
RequestHelper() |
Modifier and Type | Method and Description |
---|---|
static <E> E |
mapObjects(E output,
Object input)
Maps two objects by copying 'get' and 'is' methods to matching 'set' methods.
|
static <R extends Request<?>,O extends BroadWorksObject> |
mapObjectToRequest(R request,
O object)
Method to map the fields of a BroadWorksObject onto a given request.
|
static <R extends Response,T extends BroadWorksObject> |
requestPerObjectProducer(BroadWorksServer bws,
List<T> objects,
Class typeParameterClass,
Class<? extends Request<R>> request,
BiConsumer<T,R> consumer)
Performs a
Request using the provided BroadWorksServer across a list of BroadWorksObject
taking the request as a single argument. |
static <S extends Request<R>,R extends Response,T extends BroadWorksObject> |
requestPerObjectProducer(BroadWorksServer bws,
List<T> objects,
Class typeParameterClass,
Class<S> request,
UnaryOperator<S> operator,
BiConsumer<T,R> consumer)
Performs a
Request using the provided BroadWorksServer across a list of BroadWorksObject
taking the request as a single argument. |
public static <R extends Response,T extends BroadWorksObject> void requestPerObjectProducer(BroadWorksServer bws, List<T> objects, Class typeParameterClass, Class<? extends Request<R>> request, BiConsumer<T,R> consumer) throws RequestException
Request
using the provided BroadWorksServer
across a list of BroadWorksObject
taking the request as a single argument.R
- The Response
type.T
- The BroadWorksObject
type.bws
- The BroadWorksServer for the procedure.objects
- The list of objects to invoke the Request
.typeParameterClass
- The BroadWorksObject
class.request
- The Request
class.consumer
- The consumer to accept responses as they are returned.RequestException
- Thrown if an error occurs while running the process.public static <S extends Request<R>,R extends Response,T extends BroadWorksObject> void requestPerObjectProducer(BroadWorksServer bws, List<T> objects, Class typeParameterClass, Class<S> request, UnaryOperator<S> operator, BiConsumer<T,R> consumer) throws RequestException
Request
using the provided BroadWorksServer
across a list of BroadWorksObject
taking the request as a single argument.R
- The Response
type.T
- The BroadWorksObject
type.bws
- The BroadWorksServer for the procedure.objects
- The list of objects to invoke the Request
.typeParameterClass
- The BroadWorksObject
class.request
- The Request
class.operator
- The operator to modify each request prior to processing.consumer
- The consumer to accept responses as they are returned.RequestException
- Thrown if an error occurs while running the process.public static <E> E mapObjects(E output, Object input) throws RequestException
E
- The output object type.output
- The returned object whose fields are modified.input
- The input object to copy fields from.RequestException
- Thrown if there the input or output is NULL or if there is a fatal error during mapping.public static <R extends Request<?>,O extends BroadWorksObject> R mapObjectToRequest(R request, O object) throws RequestException
R
- The Request
typeO
- The BroadWorksObject
typerequest
- The request to map the fields onto.object
- The object to retrieve available fields.RequestException
- Thrown if there the input or output is NULL or if there is a fatal error during mapping.Copyright © 2016 ECG. All rights reserved.