This class represents a MultiMap of String keys to a List of String values.

It's useful in Vert.x to represent things in Vert.x like HTTP headers and HTTP parameters which allow multiple values for keys.

no subtypes hierarchy

Initializer
MultiMap(MultiMap unknown)
Inherited Attributes
Attributes inherited from: Object
hash, string
Methods
addshared default MultiMap add(String name, String value)

Adds a new value with the specified name and value.

Parameters:
  • name

    The name

  • value

    The value being added

addAllshared default MultiMap addAll(MultiMap map)

Adds all the entries from another MultiMap to this one

clearshared default MultiMap clear()

Removes all

containsshared default Boolean contains(String name)

Checks to see if there is a value with the specified name

Parameters:
  • name

    The name to search for

containsshared default Boolean contains(String name, String value, Boolean caseInsensitive)

Check if there is a header with the specified name and value.

If caseInsensitive is true, value is compared in a case-insensitive way.

Parameters:
  • name

    the name to search for

  • value

    the value to search for

getshared default String? get(String name)

Returns the value of with the specified name. If there are more than one values for the specified name, the first value is returned.

Parameters:
  • name

    The name of the header to search

getAllshared default List<String> getAll(String name)

Returns the values with the specified name

Parameters:
  • name

    The name to search

isEmptyshared default Boolean isEmpty()

Return true if empty

namesshared default Set<String> names()

Gets a immutable Set of all names

removeshared default MultiMap remove(String name)

Removes the value with the given name

Parameters:
  • name

    The name of the value to remove

setshared default MultiMap set(String name, String value)

Sets a value under the specified name.

If there is an existing header with the same name, it is removed.

Parameters:
  • name

    The name

  • value

    The value

setAllshared default MultiMap setAll(MultiMap map)

Cleans this instance.

sizeshared default Integer size()

Return the number of keys.

Inherited Methods
Methods inherited from: Object
equals