Options
All
  • Public
  • Public/Protected
  • All
Menu

Class 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.

Hierarchy

  • MultiMap

Index

Methods

add

  • add(name: string, value: string): MultiMap
  • add(name: string, value: string): MultiMap
  • add(name: string, values: any): MultiMap
  • add(name: string, values: any): MultiMap
  • Adds a new value with the specified name and value.

    Parameters

    • name: string
    • value: string

    Returns MultiMap

  • Like {@link MultiMap#add} but accepting CharSequence as parameters

    Parameters

    • name: string
    • value: string

    Returns MultiMap

  • Adds a new values under the specified name

    Parameters

    • name: string
    • values: any

    Returns MultiMap

  • Like {@link MultiMap#add} but accepting CharSequence as parameters

    Parameters

    • name: string
    • values: any

    Returns MultiMap

addAll

  • Adds all the entries from another MultiMap to this one

    Parameters

    Returns MultiMap

  • Adds all the entries from a Map to this

    Parameters

    • headers: {}
      • [key: string]: string

    Returns MultiMap

clear

  • Removes all

    Returns MultiMap

contains

  • contains(name: string): boolean
  • contains(name: string, value: string, caseInsensitive: boolean): boolean
  • contains(name: string): boolean
  • contains(name: string, value: string, caseInsensitive: boolean): boolean
  • Checks to see if there is a value with the specified name

    Parameters

    • name: string

    Returns boolean

  • 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: string
    • value: string
    • caseInsensitive: boolean

    Returns boolean

  • Like {@link MultiMap#contains} but accepting a CharSequence as a parameter

    Parameters

    • name: string

    Returns boolean

  • Like {@link MultiMap#contains} but accepting CharSequence parameters.

    Parameters

    • name: string
    • value: string
    • caseInsensitive: boolean

    Returns boolean

entries

  • entries(): any
  • Returns all entries in the multi-map.

    Returns any

forEach

  • forEach(action: any): void
  • Allows iterating over the entries in the map

    Parameters

    • action: any

    Returns void

get

  • get(name: string): string | null
  • get(name: string): string
  • 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: string

    Returns string | null

  • Parameters

    • name: string

    Returns string

getAll

  • getAll(name: string): string
  • getAll(name: string): string
  • Returns the values with the specified name

    Parameters

    • name: string

    Returns string

  • Like {@link MultiMap#getAll} but accepting a CharSequence as a parameter

    Parameters

    • name: string

    Returns string

isEmpty

  • isEmpty(): boolean
  • Return true if empty

    Returns boolean

names

  • names(): string
  • Gets a immutable Set of all names

    Returns string

remove

  • Removes the value with the given name

    Parameters

    • name: string

    Returns MultiMap

  • Like {@link MultiMap#remove} but accepting CharSequence as parameters

    Parameters

    • name: string

    Returns MultiMap

set

  • set(name: string, value: string): MultiMap
  • set(name: string, value: string): MultiMap
  • set(name: string, values: any): MultiMap
  • set(name: string, values: any): MultiMap
  • Sets a value under the specified name.

    If there is an existing header with the same name, it is removed. Setting a null value removes the entry.

    Parameters

    • name: string
    • value: string

    Returns MultiMap

  • Like {@link MultiMap#set} but accepting CharSequence as parameters

    Parameters

    • name: string
    • value: string

    Returns MultiMap

  • Sets values for the specified name.

    Parameters

    • name: string
    • values: any

    Returns MultiMap

  • Like {@link MultiMap#set} but accepting CharSequence as parameters

    Parameters

    • name: string
    • values: any

    Returns MultiMap

setAll

  • Cleans this instance.

    Parameters

    Returns MultiMap

  • Cleans and set all values of the given instance

    Parameters

    • headers: {}
      • [key: string]: string

    Returns MultiMap

size

  • size(): number
  • Return the number of keys.

    Returns number

Static caseInsensitiveMultiMap

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

    Returns MultiMap

Generated using TypeDoc