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
ConstructorsModifierConstructorDescriptionprotectedRequestPartDescriptor(String name) Creates a newRequestPartDescriptordescribing the request part with the givenname. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()Returns the name of the request part being described by this descriptor.final booleanReturnstrueif the described request part is optional, otherwisefalse.final RequestPartDescriptoroptional()Marks the request part as optional.Methods inherited from class org.springframework.restdocs.snippet.IgnorableDescriptor
ignored, isIgnoredMethods inherited from class org.springframework.restdocs.snippet.AbstractDescriptor
attributes, description, getAttributes, getDescription
-
Constructor Details
-
RequestPartDescriptor
Creates a newRequestPartDescriptordescribing 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()Returnstrueif the described request part is optional, otherwisefalse.- Returns:
trueif the described request part is optional, otherwisefalse
-