Enum Class BraveResource

java.lang.Object
java.lang.Enum<BraveResource>
net.ygbstudio.jbrave.core.domain.verticals.BraveResource
All Implemented Interfaces:
Serializable, Comparable<BraveResource>, Constable, BraveAPIConstant, SearchVertical

public enum BraveResource extends Enum<BraveResource> implements SearchVertical
Enum representing the different search resources of the Brave API.
See Also:
  • Enum Constant Details

    • WEB

      public static final BraveResource WEB
      The web search resource.
    • IMAGE

      public static final BraveResource IMAGE
      The image search resource.
    • VIDEO

      public static final BraveResource VIDEO
      The video search resource.
    • NEWS

      public static final BraveResource NEWS
      The news search resource.
    • SUGGEST

      public static final BraveResource SUGGEST
      The query suggestion (autocomplete) resource.
    • SPELLCHECK

      public static final BraveResource SPELLCHECK
      The spellcheck resource.
  • Method Details

    • values

      public static BraveResource[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static BraveResource valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • value

      public String value()
      Description copied from interface: BraveAPIConstant
      Returns the value of the constant. Must be implemented by the enum constants.
      Specified by:
      value in interface BraveAPIConstant
      Returns:
      the value of the constant
    • urlParam

      @Contract(pure=true) @NotNull public @NotNull String urlParam()
      Description copied from interface: BraveAPIConstant
      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.

      Specified by:
      urlParam in interface BraveAPIConstant
      Returns:
      the URL parameter associated with this constant
      See Also: