Interface NamedValues

All Known Implementing Classes:
MapNamedValues, QueryParameters

@Incubating @SuppressJQAssistant(reason="We want to use the get/getOptional methods in this interface and there are some rules that prevents get*() methods on public types.") public interface NamedValues
  • Method Details

    • get

      <T> T get(String name, Class<T> paramType)
      Type Parameters:
      T - The expected type of the value.
      Parameters:
      name - The name of the value.
      paramType - The expected type of the parameter.
      Returns:
      The value with the given name.
      Throws:
      SearchException - If there is no value with the given name.
      ClassCastException - If the value with the given name cannot be cast to the expected type.
    • getOptional

      <T> Optional<T> getOptional(String name, Class<T> paramType)
      Type Parameters:
      T - The expected type of the value.
      Parameters:
      name - The name of the value.
      paramType - The expected type of the parameter.
      Returns:
      An optional containing the value with the given name, or Optional.empty() if there is none.
      Throws:
      ClassCastException - If the value with the given name cannot be cast to the expected type.