Package org.apache.juneau.http.header
Class HttpStringHeader
java.lang.Object
org.apache.juneau.http.header.HttpHeaderBean
org.apache.juneau.http.header.HttpStringHeader
- All Implemented Interfaces:
HttpHeader
- Direct Known Subclasses:
AcceptRanges,Authorization,CacheControl,ClientVersion,Connection,ContentEncoding,ContentRange,ContentSecurityPolicy,Expect,Forwarded,From,Host,Origin,Pragma,ProxyAuthenticate,ProxyAuthorization,Range,Server,Trailer,TransferEncoding,UserAgent,Warning,WwwAuthenticate
Base type for HTTP headers whose value is an opaque string (or lazy
Supplier of string).
See Also:
- Since:
- 9.2.1
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpStringHeader(String name, String value) protectedHttpStringHeader(String name, Supplier<String> valueSupplier) -
Method Summary
Modifier and TypeMethodDescriptionstatic HttpStringHeaderCreates anHttpStringHeaderwith the given name and value.static HttpStringHeaderCreates anHttpStringHeaderwith the given name and lazy value supplier.static HttpStringHeaderMethods inherited from class org.apache.juneau.http.header.HttpHeaderBean
equals, equalsIgnoreCase, getName, getValue, hashCode, toString
-
Constructor Details
-
HttpStringHeader
- Parameters:
name- Header name. Must not benull.value- Wire value. May benull.
-
HttpStringHeader
- Parameters:
name- Header name. Must not benull.valueSupplier- Lazy wire value supplier. Must not benull.
-
-
Method Details
-
of
Creates anHttpStringHeaderwith the given name and value.- Parameters:
name- Header name. Must not benull.value- Wire value. May benull.- Returns:
- A new instance. Never
null.
-
of
Creates anHttpStringHeaderwith the given name and lazy value supplier.- Parameters:
name- Header name. Must not benull.valueSupplier- Lazy wire value supplier. Must not benull.- Returns:
- A new instance. Never
null.
-
ofPair
Parses a header line of the form"Name: value"(or"Name=value") into anHttpStringHeader.If the input does not contain
':'or'=', the entire string is treated as a header name with an empty value.- Parameters:
pair- The header pair. May benull.- Returns:
- A new instance, or
nullifpairisnull.
-