Interface SearchOptionCarrier<V>

Type Parameters:
V - the type of the option provided
All Known Implementing Classes:
BraveSearchOption

public interface SearchOptionCarrier<V>
An interface that represents a carrier for a SearchOption and its corresponding value.

It acts as a building bridge by uniting ProvidedOption and ClientProvidedOption implementations.

Options provided by the API offer automatic conversion to a SearchOptionCarrier, whereas SearchOption implementations that depend on client-provided values need to make sure this conversion happens correctly via typed factories. In other words, your user-provided value must be of type V according to the primitive type required by the API.

This allows for type validation before construction since all parameters and their values are built and send as a single URL string after joining.

  • Method Summary

    Modifier and Type
    Method
    Description
    Builds the URL-ready parameter for this search option to be joined.
    Returns the SearchOption associated with this carrier.
    Returns the value associated with this carrier.
  • Method Details

    • option

      SearchOption option()
      Returns the SearchOption associated with this carrier.
      Returns:
      the SearchOption
    • value

      V value()
      Returns the value associated with this carrier.
      Returns:
      the value
    • buildParam

      String buildParam()
      Builds the URL-ready parameter for this search option to be joined.

      For example: option=value

      Returns:
      the URL parameter for this search option