Class RequestPartDescriptor
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<T>
org.springframework.restdocs.snippet.IgnorableDescriptor<RequestPartDescriptor>
org.springframework.restdocs.request.RequestPartDescriptor
A descriptor of a request part.
- Since:
- 1.1.0
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
RequestPartDescriptor
(String name) Creates a newRequestPartDescriptor
describing the request part with the givenname
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getName()
Returns the name of the request part being described by this descriptor.final boolean
Returnstrue
if the described request part is optional, otherwisefalse
.final RequestPartDescriptor
optional()
Marks the request part as optional.Methods inherited from class org.springframework.restdocs.snippet.IgnorableDescriptor
ignored, isIgnored
Methods inherited from class org.springframework.restdocs.snippet.AbstractDescriptor
attributes, description, getAttributes, getDescription
-
Constructor Details
-
RequestPartDescriptor
Creates a newRequestPartDescriptor
describing the request part with the givenname
.- Parameters:
name
- the name of the request part
-
-
Method Details
-
optional
Marks the request part as optional.- Returns:
this
-
getName
Returns the name of the request part being described by this descriptor.- Returns:
- the name of the parameter
-
isOptional
public final boolean isOptional()Returnstrue
if the described request part is optional, otherwisefalse
.- Returns:
true
if the described request part is optional, otherwisefalse
-