Class GenericQueryParameters

java.lang.Object
io.inverno.mod.http.base.internal.GenericQueryParameters
All Implemented Interfaces:
QueryParameters

public class GenericQueryParameters extends Object implements QueryParameters

A generic QueryParameters implementation.

Since:
1.6
Author:
Jeremy Kuhn
  • Constructor Details

    • GenericQueryParameters

      public GenericQueryParameters(Map<String,List<String>> queryParameters, ObjectConverter<String> parameterConverter)

      Creates query parameters.

      Parameters:
      queryParameters - a map of query parameters extracted from the query URI
      parameterConverter - a parameter converter
  • Method Details

    • contains

      public boolean contains(String name)
      Description copied from interface: QueryParameters

      Determines whether a parameter with the specified name is present.

      Specified by:
      contains in interface QueryParameters
      Parameters:
      name - a query parameter name
      Returns:
      true if a parameter is present, false otherwise
    • getNames

      public Set<String> getNames()
      Description copied from interface: QueryParameters

      Returns the names of the query parameters sent in the request.

      Specified by:
      getNames in interface QueryParameters
      Returns:
      a list of header names
    • get

      public Optional<Parameter> get(String name)
      Description copied from interface: QueryParameters

      Returns the query parameter with the specified name.

      If there are multiple parameters with the same name, this method returns the first one.

      Specified by:
      get in interface QueryParameters
      Parameters:
      name - a query parameter name
      Returns:
      an optional returning the parameter or an empty optional if there's no parameter with the specified name
    • getAll

      public List<Parameter> getAll(String name)
      Description copied from interface: QueryParameters

      Returns all query parameters with the specified name.

      Specified by:
      getAll in interface QueryParameters
      Parameters:
      name - a query parameter name
      Returns:
      a list of parameters or an empty list if there's no parameter with the specified name
    • getAll

      public Map<String,List<Parameter>> getAll()
      Description copied from interface: QueryParameters

      Returns all query parameters sent in the request.

      Specified by:
      getAll in interface QueryParameters
      Returns:
      the parameters grouped by name