Class MultivaluedMaps


  • public final class MultivaluedMaps
    extends Object
    Enables creating instances of MultivaluedMap.

    JAX-RS 2.x provides ready to use implementation classes at specification level (e.g. javax.ws.rs.core.MultivaluedHashMap. JAX-RS 1.x was only defining the interface, with classes being provided by specific implementations. This class enables obtaining map instances when either JAX-RS 1.x or 2.x is used, without relying on a specific implementation.

    Since:
    3.0.0
    • Method Detail

      • create

        public static final <K,​V> MultivaluedMap<K,​V> create()
        Creates an instance of javax.ws.rs.core.MultivaluedMap.
        Type Parameters:
        K - the type of keys maintained by this map.
        V - the type of mapped values.
        Returns:
        a new map instance.
      • createCaseInsensitive

        public static final <V> MultivaluedMap<String,​V> createCaseInsensitive()
        Creates an instance of javax.ws.rs.core.MultivaluedMap where keys are non case sensitive Strings. This method is notably useful for a map of HTTP headers, which are not case sensitive.
        Type Parameters:
        V - the type of mapped values.
        Returns:
        a new map instance.