Class ApiOptionalResponse.BuilderBase<B extends ApiOptionalResponse.BuilderBase<B,T,X,R>,T extends ApiOptionalResponse<R>,X,R>
java.lang.Object
io.helidon.integrations.common.rest.ApiResponse.Builder<B,T>
io.helidon.integrations.common.rest.ApiOptionalResponse.BuilderBase<B,T,X,R>
- Type Parameters:
B
- type of the builder (extending the base builder)T
- type of the subclass ofApiOptionalResponse
X
- type of the entity (JsonObject, byte[])R
- type of the (optional) response object
- All Implemented Interfaces:
Builder<B,
,T> ResponseBuilder<B,
,T, X> Supplier<T>
- Direct Known Subclasses:
ApiOptionalResponse.Builder
,VaultOptionalResponse.BuilderBase
- Enclosing class:
ApiOptionalResponse<R>
public abstract static class ApiOptionalResponse.BuilderBase<B extends ApiOptionalResponse.BuilderBase<B,T,X,R>,T extends ApiOptionalResponse<R>,X,R>
extends ApiResponse.Builder<B,T>
implements ResponseBuilder<B,T,X>
Fluent API builder base for subclasses of
ApiOptionalResponse
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionentity()
Entity as received from network.Configure the entity.The configured entity processor.entityProcessor
(Function<X, R> processor) A function to convert the entity to target object.Methods inherited from class io.helidon.integrations.common.rest.ApiResponse.Builder
headers, headers, me, requestId, requestId, status, status
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.helidon.integrations.common.rest.ResponseBuilder
headers, requestId, status
-
Constructor Details
-
BuilderBase
protected BuilderBase()New builder.
-
-
Method Details
-
entity
Configure the entity. Invoked byRestApi
.- Specified by:
entity
in interfaceResponseBuilder<B extends ApiOptionalResponse.BuilderBase<B,
T, X, R>, T extends ApiOptionalResponse<R>, X> - Parameters:
entity
- entity to use (only called if present)- Returns:
- updated builder
-
entityProcessor
A function to convert the entity to target object. The processor is only invoked in case an entity is present.- Parameters:
processor
- create response object from entity- Returns:
- updated builder
-
entity
Entity as received from network.- Returns:
- entity if present, empty otherwise
-
entityProcessor
The configured entity processor.- Returns:
- processor
-