Package org.apache.juneau.http.header
Class HttpDateHeader
java.lang.Object
org.apache.juneau.http.header.HttpHeaderBean
org.apache.juneau.http.header.HttpDateHeader
- All Implemented Interfaces:
HttpHeader
- Direct Known Subclasses:
Date,Expires,IfModifiedSince,IfUnmodifiedSince,LastModified
Base for HTTP-date headers.
- Since:
- 9.2.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttpDateHeader(String name, String value) Constructor.protectedHttpDateHeader(String name, ZonedDateTime value) Constructor.protectedHttpDateHeader(String name, Supplier<?> supplier, int lazyMode) Constructor with lazy value supplier. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()Returns the RFC-1123 wire-format value of this header.static HttpDateHeaderCreates anHttpDateHeaderby parsing the given RFC-1123 wire-format value.static HttpDateHeaderof(String name, ZonedDateTime typedValue) Creates anHttpDateHeaderwith the given typed value.orElse(ZonedDateTime other) Returns the parsed value of this header, or the specified default if unset.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_ZONED_DATE_TIME
- See Also:
-
-
Constructor Details
-
HttpDateHeader
Constructor.- Parameters:
name- Header name. Must not benull .value- Wire value. Can benull or empty, in which case the parsed value isnull .
-
HttpDateHeader
Constructor.- Parameters:
name- Header name. Must not benull .value- The date value. Can benull , in which case the parsed value isnull .
-
HttpDateHeader
Constructor with lazy value supplier.- Parameters:
name- Header name. Must not benull .supplier- The lazy value supplier. Must not benull .lazyMode- EitherLAZY_WIRE_STRINGorLAZY_ZONED_DATE_TIME.
-
-
Method Details
-
of
Creates anHttpDateHeaderby parsing the given RFC-1123 wire-format value.- Parameters:
name- Header name. Must not benull.wireValue- Wire value (e.g."Sun, 06 Nov 1994 08:49:37 GMT"). May benullor empty.- Returns:
- A new instance. Never
null.
-
of
Creates anHttpDateHeaderwith the given typed value.- Parameters:
name- Header name. Must not benull.typedValue- The date value. May benull.- Returns:
- A new instance. Never
null.
-
asZonedDateTime
-
getValue
Returns the RFC-1123 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 to allow anull result when the header is unset.- Returns:
- The parsed value, or
other if the value is unset. Can benull ifother isnull .
-
toZonedDateTime
Returns the parsed value of this header.- Returns:
- The parsed value, or
null if the value is unset.
-