Class ApiRoot

java.lang.Object
dev.getelements.elements.rest.test.ApiRoot

public class ApiRoot extends Object
  • Constructor Details

    • ApiRoot

      public ApiRoot()
  • Method Details

    • get

      public String get()
      Gets the API Root URL.
      Returns:
      the api root url
    • formatTarget

      public jakarta.ws.rs.client.WebTarget formatTarget(String format, Object... args)
      Formats the final URL to include the base URL appended to the supplied format arguments.
      Parameters:
      format - the format string
      args - the format arguments
      Returns:
      the resulting URL
    • formatPagination

      public jakarta.ws.rs.client.WebTarget formatPagination(String format, int offset, int count, Object... args)
      Generates a target for a pagination. The formatted string must provide a format capable accepting a query string as this will automatically append 'offset=theOffset&count=theCount' but will not account for the presence of '&' or '?' when formatting the query string.
      Parameters:
      format - formats
      offset - the offset
      count - the count
      Returns:
      the WebTarget for the requested API
    • toString

      public String toString()
      Returns the literal value of the API Root, making it suitable for use in format arguments.
      Overrides:
      toString in class Object
      Returns:
      the api root