Package org.opensearch.rest
Class NamedRoute.Builder
java.lang.Object
org.opensearch.rest.NamedRoute.Builder
- Enclosing class:
NamedRoute
Builder class for constructing instances of
NamedRoute
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a new instance ofNamedRoute
based on the provided parameters.handler
(Function<RestRequest, RestResponse> handler) Sets the handler for this routelegacyActionNames
(Set<String> legacyActionNames) Sets the legacy action names for the route.method
(RestRequest.Method method) Sets the REST method for the route.Sets the URL path for the route.uniqueName
(String name) Sets the name for the route.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
method
Sets the REST method for the route.- Parameters:
method
- the REST method for the route- Returns:
- the builder instance
-
path
Sets the URL path for the route.- Parameters:
path
- the URL path for the route- Returns:
- the builder instance
-
uniqueName
Sets the name for the route.- Parameters:
name
- the name for the route- Returns:
- the builder instance
-
legacyActionNames
Sets the legacy action names for the route.- Parameters:
legacyActionNames
- the legacy action names for the route- Returns:
- the builder instance
-
handler
Sets the handler for this route- Parameters:
handler
- the handler for this route- Returns:
- the builder instance
-
build
Builds a new instance ofNamedRoute
based on the provided parameters.- Returns:
- a new instance of
NamedRoute
- Throws:
org.opensearch.OpenSearchException
- if the route name is invalid
-