Package org.apache.juneau.rest.httppart
Class RequestHeader
java.lang.Object
org.apache.juneau.rest.httppart.RequestHttpPart
org.apache.juneau.rest.httppart.RequestHeader
- All Implemented Interfaces:
Header,NameValuePair
Represents a single header on an HTTP request.
Typically accessed through the RequestHeaders class.
Some important methods on this class are:
RequestHeader- Methods for retrieving simple string values:
- Methods for retrieving as other common types:
asBoolean()asBooleanHeader()asCsvArray()asCsvArrayHeader()asDate()asDateHeader()asEntityTagArrayHeader()asEntityTagHeader()asInteger()asIntegerHeader()asLong()asLongHeader()asMatcher(Pattern)asMatcher(String)asMatcher(String,int)asStringHeader()asStringRangeArrayHeader()asUriHeader()
- Methods for retrieving as custom types:
- Methods for performing assertion checks:
- Other methods:
See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of this header as aBasicBooleanHeader.Returns the value of this header as aBasicCsvHeader.Returns the value of this header as aBasicDateHeader.Returns the value of this header as aBasicEntityTagHeader.Returns the value of this header as aBasicEntityTagsHeader.Returns the value of this header as aBasicIntegerHeader.Returns the value of this header as aBasicLongHeader.Returns the value of this header as aBasicStringHeader.Returns the value of this header as aBasicStringRangesHeader.Returns the value of this header as aBasicUriHeader.Sets a default value for this part.Parses the value.parser(HttpPartParserSession value) Specifies the part parser to use for this part.schema(HttpPartSchema value) Specifies the part schema for this part.toString()Methods inherited from class org.apache.juneau.rest.httppart.RequestHttpPart
as, as, as, asBoolean, asBooleanPart, asCsvArray, asCsvArrayPart, asDate, asDatePart, asInteger, asIntegerPart, asLong, asLongPart, asMatcher, asMatcher, asMatcher, assertCsvArray, assertDate, assertInteger, assertLong, assertString, asString, asStringPart, asUriPart, get, getName, getRequest, getValue, isPresent, orElseMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.http.NameValuePair
getName, getValue
-
Constructor Details
-
RequestHeader
Constructor.- Parameters:
request- The request object.name- The header name.value- The header value.
-
-
Method Details
-
asBooleanHeader
Returns the value of this header as aBasicBooleanHeader.- Returns:
- The value of this header as a
BasicBooleanHeader, nevernull .
-
asCsvHeader
Returns the value of this header as aBasicCsvHeader.- Returns:
- The value of this header as a
BasicCsvHeader, nevernull .
-
asDateHeader
Returns the value of this header as aBasicDateHeader.- Returns:
- The value of this header as a
BasicDateHeader, nevernull .
-
asEntityTagHeader
Returns the value of this header as aBasicEntityTagHeader.- Returns:
- The value of this header as a
BasicEntityTagHeader, nevernull .
-
asEntityTagsHeader
Returns the value of this header as aBasicEntityTagsHeader.- Returns:
- The value of this header as a
BasicEntityTagsHeader, nevernull .
-
asIntegerHeader
Returns the value of this header as aBasicIntegerHeader.- Returns:
- The value of this header as a
BasicIntegerHeader, nevernull .
-
asLongHeader
Returns the value of this header as aBasicLongHeader.- Returns:
- The value of this header as a
BasicLongHeader, nevernull .
-
asStringHeader
Returns the value of this header as aBasicStringHeader.- Returns:
- The value of this header as a
BasicStringHeader, nevernull .
-
asStringRangesHeader
Returns the value of this header as aBasicStringRangesHeader.- Returns:
- The value of this header as a
BasicStringRangesHeader, nevernull .
-
asUriHeader
Returns the value of this header as aBasicUriHeader.- Returns:
- The value of this header as a
BasicUriHeader, nevernull .
-
def
Description copied from class:RequestHttpPartSets a default value for this part.- Overrides:
defin classRequestHttpPart- Parameters:
def- The default value.- Returns:
- This object.
-
getElements
Parses the value.- Specified by:
getElementsin interfaceHeader- Returns:
- An array of
HeaderElemententries, may be empty, but is nevernull . - Throws:
BasicHttpException- In case of a parsing error.
-
parser
Description copied from class:RequestHttpPartSpecifies the part parser to use for this part.If not specified, uses the part parser defined on the client by calling
RestContext.Builder.partParser().- Overrides:
parserin classRequestHttpPart- Parameters:
value- The new part parser to use for this part.
Ifnull ,SimplePartParser.DEFAULTwill be used.- Returns:
- This object.
-
schema
Description copied from class:RequestHttpPartSpecifies the part schema for this part.Used by schema-based part parsers such as
OpenApiParser.- Overrides:
schemain classRequestHttpPart- Parameters:
value- The part schema.- Returns:
- This object.
-
toString
- Overrides:
toStringin classRequestHttpPart
-