Class NamedRoute.Builder

java.lang.Object
org.opensearch.rest.NamedRoute.Builder
Enclosing class:
NamedRoute

public static class NamedRoute.Builder extends Object
Builder class for constructing instances of NamedRoute.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • method

      public NamedRoute.Builder method(RestRequest.Method method)
      Sets the REST method for the route.
      Parameters:
      method - the REST method for the route
      Returns:
      the builder instance
    • path

      public NamedRoute.Builder path(String path)
      Sets the URL path for the route.
      Parameters:
      path - the URL path for the route
      Returns:
      the builder instance
    • uniqueName

      public NamedRoute.Builder uniqueName(String name)
      Sets the name for the route.
      Parameters:
      name - the name for the route
      Returns:
      the builder instance
    • legacyActionNames

      public NamedRoute.Builder legacyActionNames(Set<String> 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

      public NamedRoute build()
      Builds a new instance of NamedRoute based on the provided parameters.
      Returns:
      a new instance of NamedRoute
      Throws:
      org.opensearch.OpenSearchException - if the route name is invalid