Package com.authlete.jaxrs.util
Class JaxRsUtils
- java.lang.Object
-
- com.authlete.jaxrs.util.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 aMap<TKey, TValue>instance from aMap<TKey, TValue[]instance.static javax.ws.rs.core.MultivaluedMap<String,String>parseFormUrlencoded(String input)Convert a string in theapplication/x-www-form-urlencodedformat into an instance ofMultivaluedMap<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 aMap<TKey, TValue[]>instance into an existingMultivaluedMap<TKey, TValue>.
-
-
-
Method Detail
-
createMultivaluedMap
public static <TKey,TValue> javax.ws.rs.core.MultivaluedMap<TKey,TValue> createMultivaluedMap(Map<TKey,TValue[]> data)
Create aMap<TKey, TValue>instance from aMap<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
nullor empty, an emptyMultivaluedMapinstance 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 aMap<TKey, TValue[]>instance into an existingMultivaluedMap<TKey, TValue>.- Parameters:
target- TargetMultivaluedMapinstance.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 theapplication/x-www-form-urlencodedformat into an instance ofMultivaluedMap<String, String>.- Parameters:
input- A string in the format ofapplication/x-www-form-urlencoded.- Returns:
- An instance of
MultivaluedMap<String, String>that represents the result of parsing the input string.
-
-