Package org.apache.juneau.http.header
Class HttpUriHeader
java.lang.Object
org.apache.juneau.http.header.HttpHeaderBean
org.apache.juneau.http.header.HttpUriHeader
- All Implemented Interfaces:
HttpHeader
- Direct Known Subclasses:
ContentLocation,Location,Referer
Base for single-URI headers.
- Since:
- 9.2.1
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpUriHeader(String name, String value) Constructor.protectedHttpUriHeader(String name, URI value) Constructor.protectedHttpUriHeader(String name, Supplier<?> supplier, int lazyMode) Constructor with lazy value supplier. -
Method Summary
Modifier and TypeMethodDescriptionasUri()getValue()Returns the wire-format value of this header.static HttpUriHeaderCreates anHttpUriHeaderby parsing the given wire-format value.static HttpUriHeaderCreates anHttpUriHeaderwith the given typed value.Returns the parsed value of this header, or the specified default if unset.toUri()Returns the parsed value of this header.Methods inherited from class org.apache.juneau.http.header.HttpHeaderBean
equals, equalsIgnoreCase, getName, hashCode, of, toString
-
Field Details
-
LAZY_WIRE_STRING
- See Also:
-
LAZY_URI
- See Also:
-
-
Constructor Details
-
HttpUriHeader
Constructor.- Parameters:
name- Header name. Must not benull .value- Wire value. Can benull or empty, in which case the parsed value isnull .
-
HttpUriHeader
Constructor.- Parameters:
name- Header name. Must not benull .value- The URI value. Can benull , in which case the parsed value isnull .
-
HttpUriHeader
Constructor with lazy value supplier.- Parameters:
name- Header name. Must not benull .supplier- The lazy value supplier. Must not benull .lazyMode- EitherLAZY_WIRE_STRINGorLAZY_URI.
-
-
Method Details
-
of
Creates anHttpUriHeaderby parsing the given wire-format value.- Parameters:
name- Header name. Must not benull.wireValue- Wire value. May benullor empty.- Returns:
- A new instance. Never
null.
-
of
Creates anHttpUriHeaderwith the given typed value.- Parameters:
name- Header name. Must not benull.typedValue- The URI value. May benull.- Returns:
- A new instance. Never
null.
-
asUri
-
getValue
Returns the 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 value of this header, or the specified default if unset.- Parameters:
other- The default value. Can benull .- Returns:
- The parsed value, or
other if the value is unset. Can benull ifother isnull .
-
toUri
Returns the parsed value of this header.- Returns:
- The parsed value, or
null if the value is unset.
-