public final class EmptyHeaderList extends java.lang.Object implements HeaderList
HeaderList that doesn't contain any Headers.| Modifier and Type | Field and Description |
|---|---|
static EmptyHeaderList |
INSTANCE
An instance of an
EmptyHeaderList. |
| Constructor and Description |
|---|
EmptyHeaderList() |
| Modifier and Type | Method and Description |
|---|---|
HeaderList |
append(Header<?>... newHeaders)
Returns a new
HeaderList that also contains the given Headers. |
HeaderList |
append(HeaderList newHeaders)
|
boolean |
contains(Header<?> header)
Returns whether this HeaderSet contains the given
Header. |
boolean |
contains(HeaderType<?> headerType)
Returns whether this HeaderSet contains a
Header of the given HeaderType. |
<T> java.util.Iterator<Header<T>> |
headersByType(HeaderType<T> headerType)
|
java.util.Iterator<Header<?>> |
iterator() |
HeaderList |
remove(HeaderType<?>... removedHeaderTypes)
Returns a new
HeaderList that doesn't contain any headers of the given types. |
int |
size()
Returns the number of
Headers in this HeaderList. |
public static final EmptyHeaderList INSTANCE
EmptyHeaderList.public java.util.Iterator<Header<?>> iterator()
iterator in interface java.lang.Iterable<Header<?>>public HeaderList append(Header<?>... newHeaders)
HeaderListHeaderList that also contains the given Headers.append in interface HeaderListnewHeaders - The Headers to add.HeaderList that contains the new Headers in addition to the Headers of this list.public HeaderList append(HeaderList newHeaders)
HeaderListappend in interface HeaderListnewHeaders - The HeaderList containing the headers to add.HeaderList that contains the new Headers in addition to the Headers of this list.public HeaderList remove(HeaderType<?>... removedHeaderTypes)
HeaderListHeaderList that doesn't contain any headers of the given types.remove in interface HeaderListpublic boolean contains(HeaderType<?> headerType)
HeaderListHeader of the given HeaderType.contains in interface HeaderListpublic boolean contains(Header<?> header)
HeaderListHeader. This is only true if the set contains a Header having the same HeaderType and
value.contains in interface HeaderListpublic <T> java.util.Iterator<Header<T>> headersByType(HeaderType<T> headerType)
HeaderListheadersByType in interface HeaderListheaderType - The HeaderType to look for.Iterator of Headers, may be empty, but never null.public int size()
HeaderListHeaders in this HeaderList.size in interface HeaderList