public interface RestCallerBuilder extends RestCaller, org.refcodes.mixin.LocatorAccessor.LocatorProperty<String>, org.refcodes.mixin.LocatorAccessor.LocatorBuilder<String,RestCallerBuilder>, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty, org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>, org.refcodes.component.LinkComponent, org.refcodes.component.ConnectionStatusAccessor, org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<RestCallerBuilder>
RestCallerBuilder
extends an RestCaller
with builder
functionality and adds lambda
support for handling the responses
addressed to this RestCaller
. The lambda
defined as
RestResponseObserver
acts as the single listener to this
RestCaller
responsible for handling the responses for which this
RestCaller
is responsible.
The locator to which a RestCallerBuilder
targets for is defined by
the LocatorAccessor.getLocator()
property.org.refcodes.mixin.LocatorAccessor.LocatorBuilder<T,B extends org.refcodes.mixin.LocatorAccessor.LocatorBuilder<T,B>>, org.refcodes.mixin.LocatorAccessor.LocatorMutator<T>, org.refcodes.mixin.LocatorAccessor.LocatorProperty<T>
org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<B extends org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<?>>, org.refcodes.net.QueryFieldsAccessor.QueryFieldsMutator, org.refcodes.net.QueryFieldsAccessor.QueryFieldsProperty
org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B extends org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<B>>, org.refcodes.net.HttpMethodAccessor.HttpMethodMutator, org.refcodes.net.HttpMethodAccessor.HttpMethodProperty
org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<T extends org.refcodes.net.HeaderFields<?,?>,B extends org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsBuilder<T,B>>, org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsMutator<T extends org.refcodes.net.HeaderFields<?,?>>, org.refcodes.net.HeaderFieldsAccessor.HeaderFieldsProperty<T extends org.refcodes.net.HeaderFields<?,?>>
org.refcodes.component.LinkComponent.LinkAutomaton
org.refcodes.component.Openable.OpenAutomaton
Modifier and Type | Method and Description |
---|---|
RestResponseObserver |
getResponseObserver()
Retrieves the
RestResponseObserver to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method. |
void |
setResponseObserver(RestResponseObserver aLambda)
Sets the
RestResponseObserver to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method. |
default RestCallerBuilder |
withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod) |
default RestCallerBuilder |
withLocator(String aLocator) |
default RestCallerBuilder |
withQueryFields(org.refcodes.net.FormFields aQueryFields) |
default <REQ> RestCallerBuilder |
withRequest(REQ aRequest) |
default RestCallerBuilder |
withRequestObserver(RestResponseObserver aLambda)
Builder method for setting the
RestResponseObserver . |
onResponse
getRequest, setRequest, toHttpBody
setQueryFields
default RestCallerBuilder withQueryFields(org.refcodes.net.FormFields aQueryFields)
withQueryFields
in interface org.refcodes.net.QueryFieldsAccessor.QueryFieldsBuilder<RestCallerBuilder>
default RestCallerBuilder withLocator(String aLocator)
withLocator
in interface org.refcodes.mixin.LocatorAccessor.LocatorBuilder<String,RestCallerBuilder>
default RestCallerBuilder withHttpMethod(org.refcodes.net.HttpMethod aHttpMethod)
withHttpMethod
in interface org.refcodes.net.HttpMethodAccessor.HttpMethodBuilder<RestCallerBuilder>
default <REQ> RestCallerBuilder withRequest(REQ aRequest)
withRequest
in interface org.refcodes.net.HttpClientRequest
RestResponseObserver getResponseObserver()
RestResponseObserver
to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method.RestResponseObserver
to handle
responses.void setResponseObserver(RestResponseObserver aLambda)
RestResponseObserver
to which any responses are
delegated upon invocation of the RestResponseObserver.onResponse(RestResponseEvent)
method.aLambda
- The (user defined) RestResponseObserver
to handle
responses, feel free to code it as lambda
expression!default RestCallerBuilder withRequestObserver(RestResponseObserver aLambda)
RestResponseObserver
.aLambda
- The (user defined) RestResponseObserver
to handle
responses, feel free to code it as lambda
expressionRestCallerBuilder
for the sake of a fluent API.Copyright © 2017. All rights reserved.