MultiMap

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.

package

Default

Methods

__construct

__construct() 

Adds a new value with the specified name and value.

add( $arg0,  $arg1) : $this

Arguments

$arg0

string

$arg1

string

Response

$this

a reference to this, so the API can be used fluently

Adds all the entries from another MultiMap to this one

addAll( $arg0) : $this

Arguments

$arg0

MultiMap

Response

$this

a reference to this, so the API can be used fluently

Create a multi-map implementation with case insensitive keys, for instance it can be used to hold some HTTP headers.

caseInsensitiveMultiMap() : \io\vertx\jphp\core\MultiMap
static

Response

\io\vertx\jphp\core\MultiMap

the multi-map

Removes all

clear() : $this

Response

$this

a reference to this, so the API can be used fluently

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

contains( $arg0,  $arg1 = null,  $arg2 = null) : boolean

param $name [string] The name to search for contains($name)

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

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

param $name [string] the name to search for param $value [string] the value to search for param $caseInsensitive [boolean] contains($name, $value, $caseInsensitive)

Arguments

$arg0

string

$arg1

string

$arg2

boolean

Response

boolean

true if at least one entry is found

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

get( $arg0) : string

Arguments

$arg0

string

Response

string

The first header value or {@code null} if there is no such entry

Returns the values with the specified name

getAll( $arg0) : array

Arguments

$arg0

string

Response

array

A immutable {@link java.util.List} of values which will be empty if no values are found

Return true if empty

isEmpty() : boolean

Response

boolean

Gets a immutable {@link java.util.Set} of all names

names() : array

Response

array

A {@link java.util.Set} of all names

Removes the value with the given name

remove( $arg0) : $this

Arguments

$arg0

string

Response

$this

a reference to this, so the API can be used fluently

Sets a value under the specified name.

set( $arg0,  $arg1) : $this

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

Arguments

$arg0

string

$arg1

string

Response

$this

a reference to this, so the API can be used fluently

Cleans this instance.

setAll( $arg0) : $this

Arguments

$arg0

MultiMap

Response

$this

a reference to this, so the API can be used fluently

Return the number of keys.

size() : integer

Response

integer