public final class HeadersUtils
extends java.lang.Object
Headers
.限定符和类型 | 方法和说明 |
---|---|
static <K,V> java.util.List<java.lang.String> |
getAllAsString(Headers<K,V,?> headers,
K name)
|
static <K,V> java.lang.String |
getAsString(Headers<K,V,?> headers,
K name)
Headers.get(Object) and convert the result to a String . |
static java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> |
iteratorAsString(java.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> headers)
|
static java.util.Set<java.lang.String> |
namesAsString(Headers<java.lang.CharSequence,java.lang.CharSequence,?> headers)
|
static <K,V> java.lang.String |
toString(java.lang.Class<?> headersClass,
java.util.Iterator<java.util.Map.Entry<K,V>> headersIt,
int size)
Helper for implementing toString for
DefaultHeaders and wrappers such as DefaultHttpHeaders. |
public static <K,V> java.util.List<java.lang.String> getAllAsString(Headers<K,V,?> headers, K name)
name
- the name of the header to retrieveList
of header values or an empty List
if no values are found.public static <K,V> java.lang.String getAsString(Headers<K,V,?> headers, K name)
Headers.get(Object)
and convert the result to a String
.headers
- the headers to get the name
fromname
- the name of the header to retrievenull
if there's no such entry.public static java.util.Iterator<java.util.Map.Entry<java.lang.String,java.lang.String>> iteratorAsString(java.lang.Iterable<java.util.Map.Entry<java.lang.CharSequence,java.lang.CharSequence>> headers)
public static <K,V> java.lang.String toString(java.lang.Class<?> headersClass, java.util.Iterator<java.util.Map.Entry<K,V>> headersIt, int size)
DefaultHeaders
and wrappers such as DefaultHttpHeaders.headersClass
- the class of headersheadersIt
- the iterator on the actual headerssize
- the size of the iteratorpublic static java.util.Set<java.lang.String> namesAsString(Headers<java.lang.CharSequence,java.lang.CharSequence,?> headers)
headers
- the headers to get the names fromSet
of header values or an empty Set
if no values are found.