public final class HeadersFactory extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
asHeaderString(List<Object> values,
RuntimeDelegate rd)
Converts a list of message header values to a single string value (with individual values separated by
','). |
static String |
asString(Object headerValue,
RuntimeDelegate rd)
Convert a message header value, represented as a general object, to it's
string representation.
|
static MultivaluedMap<String,String> |
asStringHeaders(MultivaluedMap<String,Object> headers)
Returns string view of passed headers.
|
static List<String> |
asStringList(List<Object> headerValues,
RuntimeDelegate rd)
Returns string view of list of header values.
|
static AbstractMultivaluedMap<String,String> |
createInbound()
Create an empty inbound message headers container.
|
static AbstractMultivaluedMap<String,Object> |
createOutbound()
Create an empty outbound message headers container.
|
static <V> MultivaluedMap<String,V> |
empty()
Get immutable empty message headers container.
|
public static AbstractMultivaluedMap<String,String> createInbound()
public static <V> MultivaluedMap<String,V> empty()
public static AbstractMultivaluedMap<String,Object> createOutbound()
public static String asString(Object headerValue, RuntimeDelegate rd)
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.public static List<String> asStringList(List<Object> headerValues, RuntimeDelegate rd)
headerValues - header values.rd - RuntimeDelegate instance (can be passed in as a perf. optimization) or null (in that case
RuntimeDelegate.getInstance() will be called for each element conversion.public static MultivaluedMap<String,String> asStringHeaders(MultivaluedMap<String,Object> headers)
headers - headers.public static String asHeaderString(List<Object> values, 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 valuesrd - RuntimeDelegate instance (can be passed in as a perf. optimization) or null (in that case
RuntimeDelegate.getInstance() will be called for each element conversion.null,
null is returned. If the list of values is empty, an empty string is returned.Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.