Class ParameterDescriptor
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<T>
org.springframework.restdocs.snippet.IgnorableDescriptor<ParameterDescriptor>
org.springframework.restdocs.request.ParameterDescriptor
A descriptor of a request or path parameter.
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
ParameterDescriptor
(String name) Creates a newParameterDescriptor
describing the parameter with the givenname
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getName()
Returns the name of the parameter being described by this descriptor.final boolean
Returnstrue
if the described parameter is optional, otherwisefalse
.final ParameterDescriptor
optional()
Marks the parameter 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
-
ParameterDescriptor
Creates a newParameterDescriptor
describing the parameter with the givenname
.- Parameters:
name
- the name of the parameter
-
-
Method Details
-
optional
Marks the parameter as optional.- Returns:
this
-
getName
Returns the name of the parameter being described by this descriptor.- Returns:
- the name of the parameter
-
isOptional
public final boolean isOptional()Returnstrue
if the described parameter is optional, otherwisefalse
.- Returns:
true
if the described parameter is optional, otherwisefalse
-