Package discord4j.rest.route
Class Route
- java.lang.Object
-
- discord4j.rest.route.Route
-
public class Route extends Object
Provides a mapping between a Discord API endpoint and its response type.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Routedelete(String uri)booleanequals(Object obj)static Routeget(String uri)HttpMethodgetMethod()Return the HTTP method for this route.StringgetUriTemplate()Return the URI template that defines this route.inthashCode()DiscordWebRequestnewRequest(Object... uriVars)Prepare a request, expanding this route template URI with the given parameters.static Routepatch(String uri)static Routepost(String uri)static Routeput(String uri)StringtoString()
-
-
-
Method Detail
-
getMethod
public HttpMethod getMethod()
Return the HTTP method for this route.- Returns:
- the
HttpMethodof thisRoute
-
newRequest
public DiscordWebRequest newRequest(Object... uriVars)
Prepare a request, expanding this route template URI with the given parameters.- Parameters:
uriVars- the values to expand each template parameter- Returns:
- a request that is ready to be routed
- See Also:
DiscordWebRequest.exchange(discord4j.rest.request.Router)
-
getUriTemplate
public String getUriTemplate()
Return the URI template that defines this route.- Returns:
- a URI template, probably containing path parameters, that is defining this
Route
-
-