An immutable class representing an HTTP header or trailer.
HttpField has a case-insensitive name and case sensitive value,
and may be multi-valued with each value separated by a comma.
HttpFields
| Modifier and Type | Class and Description |
|---|---|
| public static class | HttpField.IntValueHttpField
A specialized |
| public static class | HttpField.LongValueHttpField
A specialized |
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final HttpHeader | |
| private final String | |
| private final String | |
| public static final QuotedStringTokenizer | NAME_VALUE_TOKENIZER
A constant |
| public static final QuotedStringTokenizer | PARAMETER_TOKENIZER
A constant |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public | HttpField(HttpHeader
the header, String HttpHeader referencing a well-known HTTP header name;
may be null in case of an unknown or custom HTTP header namethe field name; if name, String null, then HttpHeader#asString() is usedthe field value; if value)null, the empty string will be usedCreates a new |
| public | HttpField(HttpHeader
the non- header, String null HttpHeader referencing a well-known HTTP header namethe field value; if value)null, the empty string will be usedCreates a new |
| public | HttpField(HttpHeader
the non- header, HttpHeaderValue null HttpHeader referencing a well-known HTTP header namethe field value; if value)null, the empty string will be usedCreates a new |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public static boolean | |
| public boolean | Returns: True iff the value is contained in the field value entirely or as the last element of a quoted comma separated list.Values to search for (case-insensitive) search)Look for a value as the last value in a possible multivalued field Parameters and specifically quality parameters are not considered. |
| public static boolean | Returns: True iff the value is contained in the field value entirely or as the last element of a quoted comma separated list.The field value to search in. value, String Values to search for (case-insensitive) search)Look for the last value in a possible multivalued field Parameters and specifically quality parameters are not considered. |
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public HttpHeader | |
| public int | |
| public long | |
| public String | |
| public String | |
| public String | |
| public List | |
| public static String | Returns: the field value without parametersthe field value, possibly with parameters valueParams, Map<String, String> An output map to populate with the parameters,
or parameters)null to strip the parametersReturns the field value and its parameters. |
| public String[] | |
| public int | |
| public boolean | |
| public boolean | Returns: whether this field has the same name as the given fieldthe field to compare the name to field)Returns whether this field has the same name as the given field. |
| private int | |
| public static String | Returns: the field value without parametersthe field value, possibly with parameters value)Returns the field value, stripped of its parameters. |
| public String | |
| public static String | valueParameters(String value, Map<String, String> parameters)
Deprecated
use
getValueParameters(String, Map) instead
|
| _hash | back to summary |
|---|---|
| private int _hash | |
| _header | back to summary |
|---|---|
| private final HttpHeader _header | |
| _name | back to summary |
|---|---|
| private final String _name | |
| _value | back to summary |
|---|---|
| private final String _value | |
| NAME_VALUE_TOKENIZER | back to summary |
|---|---|
| public static final QuotedStringTokenizer NAME_VALUE_TOKENIZER A constant | |
| PARAMETER_TOKENIZER | back to summary |
|---|---|
| public static final QuotedStringTokenizer PARAMETER_TOKENIZER A constant | |
| ZERO_QUALITY | back to summary |
|---|---|
| private static final String ZERO_QUALITY | |
| HttpField | back to summary |
|---|---|
| public HttpField(HttpHeader header, String name, String value) Creates a new A
| |
| HttpField | back to summary |
|---|---|
| public HttpField(HttpHeader header, String value) Creates a new
| |
| HttpField | back to summary |
|---|---|
| public HttpField(HttpHeader header, HttpHeaderValue value) Creates a new
| |
| HttpField | back to summary |
|---|---|
| public HttpField(String name, String value) Creates a new | |
| contains | back to summary |
|---|---|
| public boolean contains(String search) Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively. Only values, and not parameters, are compared with the search string.
| |
| contains | back to summary |
|---|---|
| public static boolean contains(String value, String search) Returns whether the given value, possibly multi-valued, contains the specified search string, case-insensitively. Only values, and not parameters, are compared with the search string. | |
| containsLast | back to summary |
|---|---|
| public boolean containsLast(String search) Look for a value as the last value in a possible multivalued field Parameters and specifically quality parameters are not considered.
| |
| containsLast | back to summary |
|---|---|
| public static boolean containsLast(String value, String search) Look for the last value in a possible multivalued field Parameters and specifically quality parameters are not considered. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getHeader | back to summary |
|---|---|
| public HttpHeader getHeader() Get the
| |
| getIntValue | back to summary |
|---|---|
public int getIntValue()
| |
| getLongValue | back to summary |
|---|---|
public long getLongValue()
| |
| getLowerCaseName | back to summary |
|---|---|
| public String getLowerCaseName() Get the field name in lower-case.
| |
| getName | back to summary |
|---|---|
| public String getName() Get the field name.
| |
| getValue | back to summary |
|---|---|
| public String getValue() Get the field value.
| |
| getValueList | back to summary |
|---|---|
| public List Returns a list of the field values. If the field value is multi-valued, the encoded field value is split
into multiple values using If the field value is single-valued, the value is wrapped into a list. | |
| getValueParameters | back to summary |
|---|---|
| public static String getValueParameters(String valueParams, Map<String, String> parameters) Returns the field value and its parameters. A field value may have parameters, typically separated by
| |
| getValues | back to summary |
|---|---|
public String[] getValues()
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| is | back to summary |
|---|---|
| public boolean is(String name) Returns whether this field name is the same as the given string. The comparison of field name is case-insensitive.
| |
| isSameName | back to summary |
|---|---|
| public boolean isSameName(HttpField field) Returns whether this field has the same name as the given field. The comparison of field name is case-insensitive via
| |
| nameHashCode | back to summary |
|---|---|
| private int nameHashCode() | |
| stripParameters | back to summary |
|---|---|
| public static String stripParameters(String value) Returns the field value, stripped of its parameters.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| valueParameters | back to summary |
|---|---|
| public static String valueParameters(String value, Map<String, String> parameters)
Deprecated use
| |
A specialized HttpField whose value is an int.
| Modifier and Type | Field and Description |
|---|---|
| private final int |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public long |
| _int | back to summary |
|---|---|
| private final int _int | |
| IntValueHttpField | back to summary |
|---|---|
| public IntValueHttpField(HttpHeader header, String name, String value, int intValue) | |
| IntValueHttpField | back to summary |
|---|---|
| public IntValueHttpField(HttpHeader header, String name, String value) | |
| IntValueHttpField | back to summary |
|---|---|
| public IntValueHttpField(HttpHeader header, String name, int intValue) | |
| IntValueHttpField | back to summary |
|---|---|
| public IntValueHttpField(HttpHeader header, int value) | |
| IntValueHttpField | back to summary |
|---|---|
| public IntValueHttpField(String header, int value) | |
| getIntValue | back to summary |
|---|---|
| public int getIntValue() Overrides org.
| |
| getLongValue | back to summary |
|---|---|
| public long getLongValue() Overrides org.
| |
A specialized HttpField whose value is a long.
| Modifier and Type | Field and Description |
|---|---|
| private final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | |
| public long |
| _long | back to summary |
|---|---|
| private final long _long | |
| LongValueHttpField | back to summary |
|---|---|
| public LongValueHttpField(HttpHeader header, String name, String value, long longValue) | |
| LongValueHttpField | back to summary |
|---|---|
| public LongValueHttpField(HttpHeader header, String name, String value) | |
| LongValueHttpField | back to summary |
|---|---|
| public LongValueHttpField(HttpHeader header, String name, long value) | |
| LongValueHttpField | back to summary |
|---|---|
| public LongValueHttpField(HttpHeader header, long value) | |
| LongValueHttpField | back to summary |
|---|---|
| public LongValueHttpField(String header, long value) | |
| getIntValue | back to summary |
|---|---|
| public int getIntValue() Overrides org.
| |
| getLongValue | back to summary |
|---|---|
| public long getLongValue() Overrides org.
| |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static String | |
| public boolean | contains(String
the string to search for search)Overrides org. Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively. |
| public List | getValueList()
Overrides org. Returns a list of the field values. |
| _list | back to summary |
|---|---|
| private final List<String> _list | |
| MultiHttpField | back to summary |
|---|---|
| public MultiHttpField(String name, List<String> list) | |
| buildValue | back to summary |
|---|---|
| private static String buildValue(List<String> list) | |
| contains | back to summary |
|---|---|
| public boolean contains(String search) Overrides org. Doc from org. Returns whether this field value, possibly multi-valued, contains the specified search string, case-insensitively. Only values, and not parameters, are compared with the search string. | |
| getValueList | back to summary |
|---|---|
| public List Overrides org. Doc from org. Returns a list of the field values. If the field value is multi-valued, the encoded field value is split
into multiple values using If the field value is single-valued, the value is wrapped into a list. | |