- java.lang.Object
-
- io.netty5.handler.codec.HeadersUtils
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <K,V>
List<String>getAllAsString(Headers<K,V,?> headers, K name)
static <K,V>
StringgetAsString(Headers<K,V,?> headers, K name)
Headers.get(Object)
and convert the result to aString
.static Iterator<Map.Entry<String,String>>
iteratorAsString(Iterable<Map.Entry<CharSequence,CharSequence>> headers)
static Set<String>
namesAsString(Headers<CharSequence,CharSequence,?> headers)
static <K,V>
StringtoString(Class<?> headersClass, Iterator<Map.Entry<K,V>> headersIt, int size)
Helper for implementing toString forDefaultHeaders
and wrappers such as DefaultHttpHeaders.
-
-
-
Method Detail
-
getAsString
public static <K,V> String getAsString(Headers<K,V,?> headers, K name)
Headers.get(Object)
and convert the result to aString
.- Parameters:
headers
- the headers to get thename
fromname
- the name of the header to retrieve- Returns:
- the first header value if the header is found.
null
if there's no such entry.
-
iteratorAsString
public static Iterator<Map.Entry<String,String>> iteratorAsString(Iterable<Map.Entry<CharSequence,CharSequence>> headers)
-
toString
public static <K,V> String toString(Class<?> headersClass, Iterator<Map.Entry<K,V>> headersIt, int size)
Helper for implementing toString forDefaultHeaders
and wrappers such as DefaultHttpHeaders.- Parameters:
headersClass
- the class of headersheadersIt
- the iterator on the actual headerssize
- the size of the iterator- Returns:
- a String representation of the headers
-
namesAsString
public static Set<String> namesAsString(Headers<CharSequence,CharSequence,?> headers)
-
-