Class ApiRoot
java.lang.Object
dev.getelements.elements.rest.test.ApiRoot
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.client.WebTarget
formatPagination
(String format, int offset, int count, Object... args) Generates a target for a pagination.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.get()
Gets the API Root URL.toString()
Returns the literal value of the API Root, making it suitable for use in format arguments.
-
Constructor Details
-
ApiRoot
public ApiRoot()
-
-
Method Details
-
get
Gets the API Root URL.- Returns:
- the api root url
-
formatTarget
Formats the final URL to include the base URL appended to the supplied format arguments.- Parameters:
format
- the format stringargs
- 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
- formatsoffset
- the offsetcount
- the count- Returns:
- the
WebTarget
for the requested API
-
toString
Returns the literal value of the API Root, making it suitable for use in format arguments.
-