public final class HeadersFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
asHeaderString(List<Object> values,
javax.ws.rs.ext.RuntimeDelegate rd)
Converts a list of message header values to a single string value (with individual values separated by
','). |
static String |
asString(Object headerValue,
javax.ws.rs.ext.RuntimeDelegate rd)
Convert a message header value, represented as a general object, to it's
string representation.
|
static javax.ws.rs.core.MultivaluedMap<String,String> |
asStringHeaders(javax.ws.rs.core.MultivaluedMap<String,Object> headers)
Returns string view of passed headers.
|
static List<String> |
asStringList(List<Object> headerValues,
javax.ws.rs.ext.RuntimeDelegate rd)
Returns string view of list of header values.
|
static javax.ws.rs.core.AbstractMultivaluedMap<String,String> |
createInbound()
Create an empty inbound message headers container.
|
static javax.ws.rs.core.AbstractMultivaluedMap<String,Object> |
createOutbound()
Create an empty outbound message headers container.
|
static <V> javax.ws.rs.core.MultivaluedMap<String,V> |
empty()
Get immutable empty message headers container.
|
public static javax.ws.rs.core.AbstractMultivaluedMap<String,String> createInbound()
public static <V> javax.ws.rs.core.MultivaluedMap<String,V> empty()
public static javax.ws.rs.core.AbstractMultivaluedMap<String,Object> createOutbound()
public static String asString(Object headerValue, javax.ws.rs.ext.RuntimeDelegate rd)
null,
this method returns null.
This method defers to RuntimeDelegate.createHeaderDelegate(java.lang.Class<T>) to
obtain a RuntimeDelegate.HeaderDelegate to convert the value to a String.
If a RuntimeDelegate.HeaderDelegate is not found then the toString()
method on the header object is utilized.
headerValue - the header value represented as an object.rd - runtime delegate instance to be used for header delegate
retrieval. If null, a default RuntimeDelegate
instance will be obtained and
used.null
if the supplied header value is null.public static List<String> asStringList(List<Object> headerValues, javax.ws.rs.ext.RuntimeDelegate rd)
headerValues - header values.rd - RuntimeDelegate instance or null (in that case RuntimeDelegate.getInstance()
will be called for before element conversion.public static javax.ws.rs.core.MultivaluedMap<String,String> asStringHeaders(javax.ws.rs.core.MultivaluedMap<String,Object> headers)
headers - headers.null if {code headers} input parameter is null.public static String asHeaderString(List<Object> values, javax.ws.rs.ext.RuntimeDelegate rd)
',').
Each single header value is converted to String using a
RuntimeDelegate.HeaderDelegate if one is available
via RuntimeDelegate.createHeaderDelegate(java.lang.Class)
for the header value class or using its toString() method if a header
delegate is not available.values - list of individual header values.rd - RuntimeDelegate instance or null (in that case RuntimeDelegate.getInstance()
will be called for before conversion of elements).null,
null is returned. If the list of values is empty, an empty string is returned.Copyright © 2007-2013, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.