Enum Class ResultFilter

java.lang.Object
java.lang.Enum<ResultFilter>
net.ygbstudio.jbrave.api.filters.ResultFilter
All Implemented Interfaces:
Serializable, Comparable<ResultFilter>, Constable, BraveAPIConstant, ClientProvidedOption, ProvidedOption, SearchFilterOption, SearchOption

public enum ResultFilter extends Enum<ResultFilter> implements SearchFilterOption, ClientProvidedOption
Enumeration of possible result filters to be used in the api requests.

A ResultFilter is typically a comma-delimited string of result types to include in the search response.

According to the official documentation: Not specifying this parameter will return back all result types in search response where data is available and a plan with the corresponding option is subscribed. The response always includes query and type to identify any query modifications and response type respectively.

Support for advanced plans is currently limited.

See Also:
  • Enum Constant Details

  • Method Details

    • values

      public static ResultFilter[] 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 ResultFilter 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:
    • from

      @Contract("_ -> new") @NotNull public static @NotNull @Unmodifiable SearchOptionCarrier<String> from(@NotNull @NotNull Set<ResultFilter> resultFilterSet)
    • toSearchOption

      @Contract(" -> new") @NotNull public @NotNull @Unmodifiable SearchOptionCarrier<String> toSearchOption()
      Description copied from interface: SearchFilterOption
      Converts this search filter to a SearchOptionCarrier that can be used to build a URL parameter.
      Specified by:
      toSearchOption in interface ProvidedOption
      Specified by:
      toSearchOption in interface SearchFilterOption
      Returns:
      a SearchOptionCarrier representing this search filter