Class 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 (returning Http.Status.OK_200; entity is not present if the response was Http.Status.NOT_FOUND_404).
  • Constructor Details

    • 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 response
      entity - entity (if mapped from HTTP entity)
  • Method Details

    • vaultResponseBuilder

      public static <R, X> VaultOptionalResponse.Builder<X,R> vaultResponseBuilder()
      A builder to create an optional response. Method name is not builder to allow subclasses to define their own builder methods.
      Type Parameters:
      X - expected entity (such as JsonObject
      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 a Http.Status.NOT_FOUND_404.
      Returns:
      list of errors from Vault