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
ConstructorsModifierConstructorDescriptionprotectedParameterDescriptor(String name) Creates a newParameterDescriptordescribing the parameter with the givenname. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()Returns the name of the parameter being described by this descriptor.final booleanReturnstrueif the described parameter is optional, otherwisefalse.final ParameterDescriptoroptional()Marks the parameter 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
-
ParameterDescriptor
Creates a newParameterDescriptordescribing 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()Returnstrueif the described parameter is optional, otherwisefalse.- Returns:
trueif the described parameter is optional, otherwisefalse
-