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 AbstractDescriptor
attributes, description, getAttributes, getDescription
-
Constructor Details
-
HeaderDescriptor
Creates a newHeaderDescriptordescribing the header with the givenname.- Parameters:
name- the name- See Also:
-
-
Method Details
-
optional
-
getName
-
isOptional
public final boolean isOptional()Returnstrueif the described header is optional, otherwisefalse.- Returns:
trueif the described header is optional, otherwisefalse
-