javax.ws.rs.core

Interface MultivaluedMap<K,V>

  • Type Parameters:
    K - the type of keys maintained by this map
    V - the type of mapped values
    All Superinterfaces:
    Map<K,List<V>>
    All Known Implementing Classes:
    AbstractMultivaluedMap, MultivaluedHashMap

    public interface MultivaluedMap<K,V>
    extends Map<K,List<V>>
    A map of key-values pairs. Each key can have zero or more values.
    Since:
    1.0
    Author:
    Paul Sandoz, Marc Hadley, Marek Potociar
    • Method Detail

      • putSingle

        void putSingle(K key,
                       V value)
        Set the key's value to be a one item list consisting of the supplied value. Any existing values will be replaced.
        Parameters:
        key - the key
        value - the single value of the key
      • add

        void add(K key,
                 V value)
        Add a value to the current list of values for the supplied key.
        Parameters:
        key - the key
        value - the value to be added.
      • getFirst

        V getFirst(K key)
        A shortcut to get the first value of the supplied key.
        Parameters:
        key - the key
        Returns:
        the first value for the specified key or null if the key is not in the map.
      • addAll

        void addAll(K key,
                    V... newValues)
        Add multiple values to the current list of values for the supplied key. If the supplied array of new values is empty, method returns immediately. Method throws a NullPointerException if the supplied array of values is null.
        Parameters:
        key - the key.
        newValues - the values to be added.
        Throws:
        NullPointerException - if the supplied array of new values is null.
        Since:
        2.0
      • addAll

        void addAll(K key,
                    List<V> valueList)
        Add all the values from the supplied value list to the current list of values for the supplied key. If the supplied value list is empty, method returns immediately. Method throws a NullPointerException if the supplied array of values is null.
        Parameters:
        key - the key.
        valueList - the list of values to be added.
        Throws:
        NullPointerException - if the supplied value list is null.
        Since:
        2.0
      • addFirst

        void addFirst(K key,
                      V value)
        Add a value to the first position in the current list of values for the supplied key.
        Parameters:
        key - the key
        value - the value to be added.
        Since:
        2.0
      • equalsIgnoreValueOrder

        boolean equalsIgnoreValueOrder(MultivaluedMap<K,V> otherMap)
        Compare the specified map with this map for equality modulo the order of values for each key. Specifically, the values associated with each key are compared as if they were ordered lists.
        Parameters:
        otherMap - map to be compared to this one.
        Returns:
        true if the maps are equal modulo value ordering.
        Since:
        2.0

Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/ws/rs/core/MultivaluedMap.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com, MultivaluedMap (Java(TM) EE 7 Specification APIs)

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.