Interface BraveAPIConstant

All Known Subinterfaces:
ClientProvidedOption, CountryIdentifier, LanguageIdentifier, ProvidedOption, RegionLocaleIdentifier, SearchFilterOption, SearchOption, SearchVertical
All Known Implementing Classes:
BraveResource, Country, Freshness, MarketLocale, ResultFilter, SafeSearch, SearchFilterMode, SearchLanguage, SearchOptions, Units

public sealed interface BraveAPIConstant permits SearchOption, SearchVertical
Interface for constants that are used in Brave API.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The base URL for the Brave API.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the URL parameter associated with this constant.
    Returns the value of the constant.
  • Field Details

  • Method Details

    • value

      String value()
      Returns the value of the constant. Must be implemented by the enum constants.
      Returns:
      the value of the constant
    • urlParam

      String urlParam()
      Returns the URL parameter associated with this constant. It can be implemented by default at the interface level with the value of the parameter.

      This method is used to generate the URL parameter for the API requests and represents a unit of option/parameterName/parameterConstant + "=" + parameterValue.

      A parameterValue may be provided by the API or require that the client provides it. By default, all options/parameters names are provided by the API.

      Returns:
      the URL parameter associated with this constant
      See Also: