Class HeaderDescriptor
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<HeaderDescriptor>
org.springframework.restdocs.headers.HeaderDescriptor
A description of a header found in a request or response.
- Author:
- Andreas Evers
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
HeaderDescriptor
(String name) Creates a newHeaderDescriptor
describing the header with the givenname
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getName()
Returns the name for the header.final boolean
Returnstrue
if the described header is optional, otherwisefalse
.final HeaderDescriptor
optional()
Marks the header as optional.Methods inherited from class org.springframework.restdocs.snippet.AbstractDescriptor
attributes, description, getAttributes, getDescription
-
Constructor Details
-
HeaderDescriptor
Creates a newHeaderDescriptor
describing the header with the givenname
.- Parameters:
name
- the name- See Also:
-
HttpHeaders
-
-
Method Details
-
optional
Marks the header as optional.- Returns:
this
-
getName
Returns the name for the header.- Returns:
- the header name
-
isOptional
public final boolean isOptional()Returnstrue
if the described header is optional, otherwisefalse
.- Returns:
true
if the described header is optional, otherwisefalse
-