Top Inners Fields Constructors Methods
org.eclipse.jetty.server.internal

public Class ResponseHttpFields

extends Object
implements Mutable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http.HttpFields.Mutable, org.eclipse.jetty.http.HttpFields, java.util.function.Supplier, java.lang.Iterable
Imports
java.util.Iterator, .ListIterator, java.util.concurrent.atomic.AtomicBoolean, java.util.stream.Stream, org.eclipse.jetty.http.HttpField, .HttpFields, .HttpHeader, .PreEncodedHttpField, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
ResponseHttpFields.Persistent

A marker interface for HttpFields that cannot be removed or cleared from a ResponseHttpFields instance.

public static class
public static class

Field Summary

Modifier and TypeField and Description
private final AtomicBoolean
private final HttpFields.Mutable
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public HttpFields.Mutable
add(HttpField
the HttpField to add
field
)

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.add.

Adds the given HttpField to this instance.

public HttpFields
asImmutable()

Overrides default org.eclipse.jetty.http.HttpFields.asImmutable.

Returns an immutable copy of this HttpFields instance.

public HttpFields.Mutable
clear()

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.clear.

Removes all the fields from this instance.

public boolean
public void
ensureField(HttpField
the field to ensure to be present
field
)

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.ensureField.

Ensures that the given HttpField is present when the field may not exist or may exist and be multi-valued.

public HttpField
getField(String
the case-insensitive field name to search for
name
)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Returns the first HttpField with the given field name, or null if no such field is present.

public HttpField
getField(HttpHeader
the field name to search for
header
)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Returns the first HttpField with the given field name, or null if no such field is present.

public HttpField
getField(int
the index of the HttpField
index
)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Returns the HttpField at the given index, or null if there is no field at the given index.

public HttpFields.Mutable
public boolean
public Iterator<HttpField>
iterator()

Overrides default org.eclipse.jetty.http.HttpFields.iterator.

Returns an iterator over elements of type T.

public ListIterator<HttpField>
public void
public int
public Stream<HttpField>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_committedback to summary
private final AtomicBoolean _committed
_fieldsback to summary
private final HttpFields.Mutable _fields
LOGback to summary
private static final Logger LOG

Constructor Detail

ResponseHttpFieldsback to summary
public ResponseHttpFields()

Method Detail

addback to summary
public HttpFields.Mutable add(HttpField field)

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.add.

Doc from org.eclipse.jetty.http.HttpFields.Mutable.add.

Adds the given HttpField to this instance.

Parameters
field:HttpField

the HttpField to add

Returns:HttpFields.Mutable

this instance

Annotations
@Override
asImmutableback to summary
public HttpFields asImmutable()

Overrides default org.eclipse.jetty.http.HttpFields.asImmutable.

Doc from org.eclipse.jetty.http.HttpFields.asImmutable.

Returns an immutable copy of this HttpFields instance.

Returns:HttpFields

a new immutable copy of this HttpFields instance

Annotations
@Override
clearback to summary
public HttpFields.Mutable clear()

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.clear.

Doc from org.eclipse.jetty.http.HttpFields.Mutable.clear.

Removes all the fields from this instance.

Returns:HttpFields.Mutable

this instance

Annotations
@Override
commitback to summary
public boolean commit()
ensureFieldback to summary
public void ensureField(HttpField field)

Overrides default org.eclipse.jetty.http.HttpFields.Mutable.ensureField.

Doc from org.eclipse.jetty.http.HttpFields.Mutable.ensureField.

Ensures that the given HttpField is present when the field may not exist or may exist and be multi-valued.

Multiple existing HttpFields are merged into a single field.

Parameters
field:HttpField

the field to ensure to be present

Annotations
@Override
getFieldback to summary
public HttpField getField(String name)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Doc from org.eclipse.jetty.http.HttpFields.getField.

Returns the first HttpField with the given field name, or null if no such field is present.

The comparison of field name is case-insensitive via HttpField#is(String).

Parameters
name:String

the case-insensitive field name to search for

Returns:HttpField

the first HttpField with the given field name, or null if no such field is present

Annotations
@Override
getFieldback to summary
public HttpField getField(HttpHeader header)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Doc from org.eclipse.jetty.http.HttpFields.getField.

Returns the first HttpField with the given field name, or null if no such field is present.

Parameters
header:HttpHeader

the field name to search for

Returns:HttpField

the first HttpField with the given field name, or null if no such field is present

Annotations
@Override
getFieldback to summary
public HttpField getField(int index)

Overrides default org.eclipse.jetty.http.HttpFields.getField.

Doc from org.eclipse.jetty.http.HttpFields.getField.

Returns the HttpField at the given index, or null if there is no field at the given index.

Parameters
index:int

the index of the HttpField

Returns:HttpField

the HttpField at the given index, or null if there is no field at the given index

Annotations
@Override
getMutableHttpFieldsback to summary
public HttpFields.Mutable getMutableHttpFields()
isCommittedback to summary
public boolean isCommitted()
iteratorback to summary
public Iterator<HttpField> iterator()

Overrides default org.eclipse.jetty.http.HttpFields.iterator.

Doc from java.lang.Iterable.iterator.

Returns an iterator over elements of type T.

Returns:Iterator<HttpField>

an Iterator.

Annotations
@Override
listIteratorback to summary
public ListIterator<HttpField> listIterator(int index)

Implements org.eclipse.jetty.http.HttpFields.listIterator.

Returns:ListIterator<HttpField>

Doc from org.eclipse.jetty.http.HttpFields.listIterator.

an iterator over the HttpFields in this HttpFields starting at the given index.

Annotations
@Override
recycleback to summary
public void recycle()
sizeback to summary
public int size()

Overrides default org.eclipse.jetty.http.HttpFields.size.

Returns:int

Doc from org.eclipse.jetty.http.HttpFields.size.

the number of HttpFields in this instance

Annotations
@Override
streamback to summary
public Stream<HttpField> stream()

Overrides default org.eclipse.jetty.http.HttpFields.stream.

Returns:Stream<HttpField>

Doc from org.eclipse.jetty.http.HttpFields.stream.

a sequential stream of the HttpFields in this instance

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
org.eclipse.jetty.server.internal back to summary

public Interface ResponseHttpFields.Persistent

Known Direct Implementers
org.eclipse.jetty.server.internal.ResponseHttpFields.PersistentHttpField, org.eclipse.jetty.server.internal.ResponseHttpFields.PersistentPreEncodedHttpField

A marker interface for HttpFields that cannot be removed or cleared from a ResponseHttpFields instance. Persistent fields are not immutable in the ResponseHttpFields and may be replaced with a different value. i.e. A Persistent field cannot be removed but can be overwritten.

Method Summary

Modifier and TypeMethod and Description
public HttpField
getOriginal()

Returns: the original persistent field set before any mutations

public static boolean

Method Detail

getOriginalback to summary
public HttpField getOriginal()
Returns:HttpField

the original persistent field set before any mutations

isPersistentback to summary
public static boolean isPersistent(HttpField field)
org.eclipse.jetty.server.internal back to summary

public Class ResponseHttpFields.PersistentHttpField

extends HttpField
implements Persistent
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent

A HttpField that is a Persistent.

Field Summary

Modifier and TypeField and Description
private final HttpField
private final HttpField
Inherited from org.eclipse.jetty.http.HttpField:
NAME_VALUE_TOKENIZERPARAMETER_TOKENIZER

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
public int
public long
public HttpField
Inherited from org.eclipse.jetty.http.HttpField:
containscontainscontainsLastcontainsLastequalsgetHeadergetLowerCaseNamegetNamegetValuegetValueListgetValueParametersgetValueshashCodeisisSameNamestripParameterstoStringvalueParameters

Field Detail

_fieldback to summary
private final HttpField _field
_originalback to summary
private final HttpField _original

Constructor Detail

PersistentHttpFieldback to summary
public PersistentHttpField(HttpField field)
PersistentHttpFieldback to summary
pack-priv PersistentHttpField(HttpField field, HttpField original)

Method Detail

getIntValueback to summary
public int getIntValue()

Overrides org.eclipse.jetty.http.HttpField.getIntValue.

Returns:int

Doc from org.eclipse.jetty.http.HttpField.getIntValue.

the value of this field as an int

Annotations
@Override
getLongValueback to summary
public long getLongValue()

Overrides org.eclipse.jetty.http.HttpField.getLongValue.

Returns:long

Doc from org.eclipse.jetty.http.HttpField.getLongValue.

the value of this field as an long

Annotations
@Override
getOriginalback to summary
public HttpField getOriginal()

Implements org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent.getOriginal.

Returns:HttpField

Doc from org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent.getOriginal.

the original persistent field set before any mutations

Annotations
@Override
org.eclipse.jetty.server.internal back to summary

public Class ResponseHttpFields.PersistentPreEncodedHttpField

extends PreEncodedHttpField
implements Persistent
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent

A PreEncodedHttpField that is a Persistent.

Field Summary

Modifier and TypeField and Description
private final HttpField

Constructor Summary

AccessConstructor and Description
public
pack-priv

Method Summary

Modifier and TypeMethod and Description
public HttpField
Inherited from org.eclipse.jetty.http.PreEncodedHttpField:
containsgetEncodedLengthgetIntValuegetLongValueputTo

Field Detail

_originalback to summary
private final HttpField _original

Constructor Detail

PersistentPreEncodedHttpFieldback to summary
public PersistentPreEncodedHttpField(HttpHeader header, String value)
PersistentPreEncodedHttpFieldback to summary
pack-priv PersistentPreEncodedHttpField(HttpHeader header, String value, HttpField original)

Method Detail

getOriginalback to summary
public HttpField getOriginal()

Implements org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent.getOriginal.

Returns:HttpField

Doc from org.eclipse.jetty.server.internal.ResponseHttpFields.Persistent.getOriginal.

the original persistent field set before any mutations

Annotations
@Override