public class RestEndpoint
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RestEndpoint.StringOrPar
Represents either a string or a
PathPar. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
genericPath()
Returns the represented generic path, e.g.,
/my/path/{id} where
{id} denotes a parameter. |
org.springframework.web.bind.annotation.RequestMethod |
method()
Gets the request method.
|
protected static RestEndpoint |
of(java.lang.String serviceName,
java.lang.String root,
java.lang.String path,
org.springframework.web.bind.annotation.RequestMethod method)
Creates a new instance.
|
java.util.List<java.lang.String> |
parsePathParameters(java.lang.String link)
Checks if the link matches the endpoint and parses the path variables.
|
java.lang.String |
path(java.lang.Object... values)
Returns the represented path with parameter instance values, e.g.,
/my/path/MyId
for the generic path /my/path/{id}. |
RequestBuilder |
requestUrl(java.lang.Object... values)
Creates the complete request URL.
|
protected static RestEndpoint of(java.lang.String serviceName, java.lang.String root, java.lang.String path, org.springframework.web.bind.annotation.RequestMethod method)
serviceName - The name of the service.root - The root path element.path - The path (without the root).method - The request method.public java.lang.String genericPath()
/my/path/{id} where
{id} denotes a parameter.public java.lang.String path(java.lang.Object... values)
/my/path/MyId
for the generic path /my/path/{id}.values - The parameter values to fill in the parameters.public RequestBuilder requestUrl(java.lang.Object... values)
values - The values for the path parameters.public org.springframework.web.bind.annotation.RequestMethod method()
public java.util.List<java.lang.String> parsePathParameters(java.lang.String link)
link - The link to be parsednull if the link does not match the endpoint.