Package org.apache.juneau.http.header
Class BasicEntityTagsHeader
java.lang.Object
org.apache.juneau.http.header.BasicHeader
org.apache.juneau.http.header.BasicEntityTagsHeader
- All Implemented Interfaces:
Serializable,Cloneable,Header,NameValuePair
- Direct Known Subclasses:
IfMatch,IfNoneMatch
Category of headers that consist of a comma-delimited list of entity validator values.
Example
If-Match: "xyzzy" If-Match: "xyzzy", "r2d2xxxx", "c3piozzzz" If-Match: *
See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBasicEntityTagsHeader(String name, String value) Constructor.BasicEntityTagsHeader(String name, Supplier<EntityTags> value) Constructor with delayed value.BasicEntityTagsHeader(String name, EntityTags value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the header value as anEntityTagswrapped in anOptional.getValue()static BasicEntityTagsHeaderStatic creator.static BasicEntityTagsHeaderof(String name, Supplier<EntityTags> value) Static creator with delayed value.static BasicEntityTagsHeaderof(String name, EntityTags value) Static creator.orElse(EntityTags other) Return the value if present, otherwise returnother .Returns the header value as anEntityTagswrapped in anOptional.Methods inherited from class org.apache.juneau.http.header.BasicHeader
assertName, assertStringValue, asString, equals, equalsIgnoreCase, get, getElements, getName, hashCode, isNotEmpty, isPresent, of, of, orElse, toString
-
Constructor Details
-
BasicEntityTagsHeader
Constructor.- Parameters:
name- The header name.value- The header value.
Must be a comma-delimited list of entity validator values (e.g."\"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"" ).
Can benull .- Throws:
IllegalArgumentException- If name isnull or empty.
-
BasicEntityTagsHeader
Constructor.- Parameters:
name- The header name.value- The header value.
Can benull .- Throws:
IllegalArgumentException- If name isnull or empty.
-
BasicEntityTagsHeader
Constructor with delayed value.Header value is re-evaluated on each call to
getValue().- Parameters:
name- The header name.value- The supplier of the header value.
Can benull .- Throws:
IllegalArgumentException- If name isnull or empty.
-
-
Method Details
-
of
Static creator.- Parameters:
name- The header name.value- The header value.
Must be a comma-delimited list of entity validator values (e.g."\"xyzzy\", \"r2d2xxxx\", \"c3piozzzz\"" ).
Can benull .- Returns:
- A new header bean, or
null if the value isnull . - Throws:
IllegalArgumentException- If name isnull or empty.
-
of
Static creator.- Parameters:
name- The header name.value- The header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull . - Throws:
IllegalArgumentException- If name isnull or empty.
-
of
Static creator with delayed value.Header value is re-evaluated on each call to
getValue().- Parameters:
name- The header name.value- The supplier of the header value.
Can benull .- Returns:
- A new header bean, or
null if the value isnull . - Throws:
IllegalArgumentException- If name isnull or empty.
-
getValue
- Specified by:
getValuein interfaceNameValuePair- Overrides:
getValuein classBasicHeader
-
asEntityTags
Returns the header value as anEntityTagswrapped in anOptional.- Returns:
- The header value as an
EntityTagswrapped in anOptional. Nevernull .
-
toEntityTags
Returns the header value as anEntityTagswrapped in anOptional.- Returns:
- The header value as an
EntityTagswrapped in anOptional. Nevernull .
-
orElse
Return the value if present, otherwise returnother .This is a shortened form for calling
asEntityTags().orElse( .other )- Parameters:
other- The value to be returned if there is no value present, can benull .- Returns:
- The value, if present, otherwise
other .
-