Class SimpleRequest

java.lang.Object
com.atlassian.oai.validator.model.SimpleRequest
All Implemented Interfaces:
Request

public class SimpleRequest extends Object implements Request
Simple immutable Request implementation.

New instances should be constructed with a SimpleRequest.Builder.

  • Method Details

    • getPath

      @Nonnull public String getPath()
      Specified by:
      getPath in interface Request
      Returns:
      the request path
    • getMethod

      @Nonnull public Request.Method getMethod()
      Specified by:
      getMethod in interface Request
      Returns:
      the HTTP request method ("GET", "PUT" etc.)
    • getBody

      @Nonnull public Optional<String> getBody()
      Specified by:
      getBody in interface Request
      Returns:
      the request body as String
    • getRequestBody

      @Nonnull public Optional<Body> getRequestBody()
      Specified by:
      getRequestBody in interface Request
      Returns:
      the request body
    • getQueryParameterValues

      @Nonnull public Collection<String> getQueryParameterValues(String name)
      Description copied from interface: Request
      Get the collection of query parameter values for the query param with the given name.
      Specified by:
      getQueryParameterValues in interface Request
      Parameters:
      name - The name of the parameter to retrieve. If not differently specified this name is case insensitive.
      Returns:
      The query parameter values for that param; or empty list
    • getQueryParameters

      @Nonnull public Collection<String> getQueryParameters()
      Specified by:
      getQueryParameters in interface Request
      Returns:
      the collection of query parameter names present on this request
    • getHeaders

      @Nonnull public Map<String,Collection<String>> getHeaders()
      Description copied from interface: Request
      Get the collection of headers on this request.

      Result will include key and all values (in the case of multiple headers with the same key)

      Specified by:
      getHeaders in interface Request
      Returns:
      The map of key->values for the headers associated with this request.
    • getHeaderValues

      @Nonnull public Collection<String> getHeaderValues(String name)
      Description copied from interface: Request
      Get the collection of header values for the header param with the given name.
      Specified by:
      getHeaderValues in interface Request
      Parameters:
      name - The (case insensitive) name of the parameter to retrieve
      Returns:
      The header values for that param; or empty list