Class JaxRsUtils


  • public class JaxRsUtils
    extends Object
    JAX-RS Utilities.
    Since:
    2.6
    • Constructor Summary

      Constructors 
      Constructor Description
      JaxRsUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <TKey,​TValue>
      javax.ws.rs.core.MultivaluedMap<TKey,​TValue>
      createMultivaluedMap​(Map<TKey,​TValue[]> data)
      Create a Map<TKey, TValue> instance from a Map<TKey, TValue[] instance.
      static javax.ws.rs.core.MultivaluedMap<String,​String> parseFormUrlencoded​(String input)
      Convert a string in the application/x-www-form-urlencoded format into an instance of MultivaluedMap<String, String>.
      static <TKey,​TValue>
      javax.ws.rs.core.MultivaluedMap<TKey,​TValue>
      putAll​(javax.ws.rs.core.MultivaluedMap<TKey,​TValue> target, Map<TKey,​TValue[]> data)
      Put all entries in a Map<TKey, TValue[]> instance into an existing MultivaluedMap<TKey, TValue>.
    • Constructor Detail

      • JaxRsUtils

        public JaxRsUtils()
    • Method Detail

      • createMultivaluedMap

        public static <TKey,​TValue> javax.ws.rs.core.MultivaluedMap<TKey,​TValue> createMultivaluedMap​(Map<TKey,​TValue[]> data)
        Create a Map<TKey, TValue> instance from a Map<TKey, TValue[] instance.
        Parameters:
        data - Input data.
        Returns:
        A new instance which contains all the entries in the input data. If the input data is null or empty, an empty MultivaluedMap instance is returned.
      • putAll

        public static <TKey,​TValue> javax.ws.rs.core.MultivaluedMap<TKey,​TValue> putAll​(javax.ws.rs.core.MultivaluedMap<TKey,​TValue> target,
                                                                                                    Map<TKey,​TValue[]> data)
        Put all entries in a Map<TKey, TValue[]> instance into an existing MultivaluedMap<TKey, TValue>.
        Parameters:
        target - Target MultivaluedMap instance.
        data - Input data.
        Returns:
        The object given as target.
      • parseFormUrlencoded

        public static javax.ws.rs.core.MultivaluedMap<String,​String> parseFormUrlencoded​(String input)
        Convert a string in the application/x-www-form-urlencoded format into an instance of MultivaluedMap<String, String>.
        Parameters:
        input - A string in the format of application/x-www-form-urlencoded.
        Returns:
        An instance of MultivaluedMap<String, String> that represents the result of parsing the input string.