Package org.apache.juneau.http.header
Class HttpCsvHeader
java.lang.Object
org.apache.juneau.http.header.HttpHeaderBean
org.apache.juneau.http.header.HttpCsvHeader
- All Implemented Interfaces:
HttpHeader
Base for simple comma-separated token lists.
- Since:
- 9.2.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpCsvHeader(String name, String value) Constructor.protectedHttpCsvHeader(String name, String... values) Constructor.protectedHttpCsvHeader(String name, Supplier<?> supplier, int lazyMode) Constructor with lazy value supplier. -
Method Summary
Modifier and TypeMethodDescriptionasArray()asList()booleanbooleancontainsIgnoreCase(String val) getValue()Returns the comma-delimited wire-format value of this header.static HttpCsvHeaderCreates anHttpCsvHeaderby parsing the given comma-delimited wire value.static HttpCsvHeaderCreates anHttpCsvHeaderwith the given typed values.String[]Returns the parsed tokens of this header, or the specified default if unset.String[]toArray()Returns the parsed tokens of this header.toList()Methods inherited from class org.apache.juneau.http.header.HttpHeaderBean
equals, equalsIgnoreCase, getName, hashCode, of, toString
-
Field Details
-
LAZY_WIRE_STRING
- See Also:
-
LAZY_TOKENS
- See Also:
-
-
Constructor Details
-
HttpCsvHeader
Constructor.- Parameters:
name- Header name. Must not benull .value- Wire value. Can benull or empty, in which case the parsed tokens arenull .
-
HttpCsvHeader
Constructor.- Parameters:
name- Header name. Must not benull .values- The token values. Can benull , in which case the parsed tokens arenull .
-
HttpCsvHeader
Constructor with lazy value supplier.- Parameters:
name- Header name. Must not benull .supplier- The lazy value supplier. Must not benull .lazyMode- EitherLAZY_WIRE_STRINGorLAZY_TOKENS.
-
-
Method Details
-
of
Creates anHttpCsvHeaderby parsing the given comma-delimited wire value.- Parameters:
name- Header name. Must not benull.wireValue- Wire value. May benullor empty.- Returns:
- A new instance. Never
null.
-
of
Creates anHttpCsvHeaderwith the given typed values.- Parameters:
name- Header name. Must not benull.typedValues- The token values. May benull.- Returns:
- A new instance. Never
null.
-
asArray
-
asList
-
contains
-
containsIgnoreCase
-
getValue
Returns the comma-delimited wire-format value of this header.- Specified by:
getValuein interfaceHttpHeader- Overrides:
getValuein classHttpHeaderBean- Returns:
- The wire value, or
null if the value is unset.
-
orElse
Returns the parsed tokens of this header, or the specified default if unset.- Parameters:
other- The default value. Can benull to allow anull result when the header is unset.- Returns:
- The parsed tokens, or
other if the value is unset. Can benull ifother isnull .
-
toArray
Returns the parsed tokens of this header.- Returns:
- The parsed tokens, or
null if the value is unset.
-
toList
-