Package io.helidon.integrations.vault
Class VaultOptionalResponse<R>
- java.lang.Object
-
- io.helidon.integrations.common.rest.ApiJsonParser
-
- io.helidon.integrations.common.rest.ApiResponse
-
- io.helidon.integrations.common.rest.ApiOptionalResponse<R>
-
- io.helidon.integrations.vault.VaultOptionalResponse<R>
-
- Type Parameters:
R
- type of the response - a subclass of this class
public final class VaultOptionalResponse<R> extends ApiOptionalResponse<R>
Response for Vault operations that may contain entity. The entity is present for successful requests (returningHttp.Status.OK_200
; entity is not present if the response wasHttp.Status.NOT_FOUND_404
).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VaultOptionalResponse.Builder<X,R>
Fluent API builder forVaultOptionalResponse
.static class
VaultOptionalResponse.BuilderBase<B extends VaultOptionalResponse.BuilderBase<B,X,R>,X,R>
Base builder class for subclasses ofVaultOptionalResponse
.
-
Constructor Summary
Constructors Modifier Constructor Description protected
VaultOptionalResponse(VaultOptionalResponse.BuilderBase<?,?,R> builder, Optional<R> entity)
Construct a new optional response from the builder and an entity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<String>
errors()
List of errors (if any) as returned by Vault.static <R,X>
VaultOptionalResponse.Builder<X,R>vaultResponseBuilder()
A builder to create an optional response.-
Methods inherited from class io.helidon.integrations.common.rest.ApiOptionalResponse
apiResponseBuilder, entity, map
-
Methods inherited from class io.helidon.integrations.common.rest.ApiResponse
headers, requestId, status
-
Methods inherited from class io.helidon.integrations.common.rest.ApiJsonParser
isPresent, stringValue, toBoolean, toBytesBase64, toDouble, toInstant, toInt, toList, toLong, toMap, toObject, toString
-
-
-
-
Constructor Detail
-
VaultOptionalResponse
protected VaultOptionalResponse(VaultOptionalResponse.BuilderBase<?,?,R> builder, Optional<R> entity)
Construct a new optional response from the builder and an entity.- Parameters:
builder
- subclass of builder of vault optional responseentity
- entity (if mapped from HTTP entity)
-
-
Method Detail
-
vaultResponseBuilder
public static <R,X> VaultOptionalResponse.Builder<X,R> vaultResponseBuilder()
A builder to create an optional response. Method name is notbuilder
to allow subclasses to define their own builder methods.- Type Parameters:
X
- expected entity (such asJsonObject
R
- type of object used to represent the entity- Returns:
- a new builder
-
errors
public List<String> errors()
List of errors (if any) as returned by Vault. This list may contain errors when we get aHttp.Status.NOT_FOUND_404
.- Returns:
- list of errors from Vault
-
-