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
ConstructorsModifierConstructorDescriptionprotectedHeaderDescriptor(String name) Creates a newHeaderDescriptordescribing the header with the givenname. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()Returns the name for the header.final booleanReturnstrueif the described header is optional, otherwisefalse.final HeaderDescriptoroptional()Marks the header as optional.Methods inherited from class org.springframework.restdocs.snippet.AbstractDescriptor
attributes, description, getAttributes, getDescription
-
Constructor Details
-
HeaderDescriptor
Creates a newHeaderDescriptordescribing 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()Returnstrueif the described header is optional, otherwisefalse.- Returns:
trueif the described header is optional, otherwisefalse
-