Package net.dv8tion.jda.api.requests
Class Route.CompiledRoute
java.lang.Object
net.dv8tion.jda.api.requests.Route.CompiledRoute
- Enclosing class:
- Route
A route compiled with arguments.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The route template with the original placeholders.The compiled route string of the endpoint, including all arguments and query parameters.The string of major parameters used by this route.The HTTP method.int
hashCode()
toString()
withQueryParams
(String... params) Returns a copy of this CompiledRoute with the provided parameters added as query.
-
Method Details
-
withQueryParams
Returns a copy of this CompiledRoute with the provided parameters added as query.
This will use percent-encoding for all provided values but not for the keys.Example Usage
Route.CompiledRoute history = Route.GET_MESSAGE_HISTORY.compile(channelId); // returns a new route route = history.withQueryParams( "limit", 100 ); // adds another parameter ontop of limit route = route.withQueryParams( "after", messageId ); // now the route has both limit and after, you can also do this in one call: route = history.withQueryParams( "limit", 100, "after", messageId );
- Parameters:
params
- The parameters to add as query, alternating key and value (see example)- Returns:
- A copy of this CompiledRoute with the provided parameters added as query
- Throws:
IllegalArgumentException
- If the number of arguments is not even or null is provided
-
getMajorParameters
The string of major parameters used by this route.
This is important for rate-limit handling.- Returns:
- The string of major parameters used by this route
-
getCompiledRoute
The compiled route string of the endpoint, including all arguments and query parameters.- Returns:
- The compiled route string of the endpoint
-
getBaseRoute
The route template with the original placeholders.- Returns:
- The route template with the original placeholders
-
getMethod
The HTTP method.- Returns:
- The HTTP method
-
hashCode
public int hashCode() -
equals
-
toString
-