Class RequestBuilder<T>

java.lang.Object
de.chojo.nexus.requests.RequestBuilder<T>
Type Parameters:
T - type of response
All Implemented Interfaces:
Request<T>
Direct Known Subclasses:
ASearchRequest, DeleteRequest, DownloadRequest, DownloadStreamRequest, DownloadToFileRequest, GetRequest, ListRequest, ListRequest

public abstract class RequestBuilder<T> extends Object implements Request<T>
A request builder used to build, execute requests and parse the response
  • Field Details

  • Constructor Details

    • RequestBuilder

      public RequestBuilder(NexusRestImpl rest)
      Create a new request builder
      Parameters:
      rest - rest client
  • Method Details

    • parameter

      public void parameter(String key, Object object)
      Adds a parameter to the uri
      Parameters:
      key - parameter key
      object - parameter value
    • path

      public void path(String... path)
      Adds an element to the path.
      Parameters:
      path - path
    • path

      public void path(Object... path)
      Adds an element to the path.
      Parameters:
      path - path
    • uri

      protected URI uri()
    • queue

      public abstract CompletableFuture<T> queue()
      Description copied from interface: Request
      Queue the request asynchronous.
      Specified by:
      queue in interface Request<T>
      Returns:
      completable future providing the response
    • complete

      public abstract T complete()
      Description copied from interface: Request
      Sends the request and handles the response on the current thread
      Specified by:
      complete in interface Request<T>
      Returns:
      response