Interface SearchVertical

All Superinterfaces:
BraveAPIConstant
All Known Implementing Classes:
BraveResource

public non-sealed interface SearchVertical extends BraveAPIConstant
An interface representing a search vertical.

This interface extends BraveAPIConstant and is implemented by enums that represent search verticals.

Each search vertical has a BraveAPIConstant.value() method that is used to get the parameter value for the API requests. All verticals are followed by the SEARCH_PATH string, and it is included here for convenience and readability as it is used in the implementation of the
BraveAPIConstant.urlParam() method by default.

See Also:
  • Field Details

  • Method Details

    • urlVertical

      @Contract(pure=true) @NotNull static @NotNull String urlVertical(@NotNull @NotNull SearchVertical vertical)
      Creates a URL query string for the given search vertical.

      This method takes a search vertical and returns a URL query string that can be used to construct a request to the Brave API. The URL query string is constructed by concatenating the value of the search vertical with the SEARCH_PATH string and appending "?q=".

      Parameters:
      vertical - the search vertical to use for constructing the URL query string
      Returns:
      the URL query string for the given search vertical