Package io.netty.handler.codec
Class HeadersUtils
java.lang.Object
io.netty.handler.codec.HeadersUtils
Provides utility methods related to
Headers
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
private static final class
private static final class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllAsString
(Headers<K, V, ?> headers, K name) static <K,
V> String getAsString
(Headers<K, V, ?> headers, K name) Headers.get(Object)
and convert the result to aString
.iteratorAsString
(Iterable<Map.Entry<CharSequence, CharSequence>> headers) namesAsString
(Headers<CharSequence, CharSequence, ?> headers) static <K,
V> String Helper for implementing toString forDefaultHeaders
and wrappers such as DefaultHttpHeaders.
-
Constructor Details
-
HeadersUtils
private HeadersUtils()
-
-
Method Details
-
getAllAsString
-
getAsString
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
-