Class CookieDescriptor
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<T>
org.springframework.restdocs.snippet.IgnorableDescriptor<CookieDescriptor>
org.springframework.restdocs.cookies.CookieDescriptor
A description of a cookie found in a request or response.
- Since:
- 3.0
- Author:
- Clyde Stubbs, Andy Wilkinson
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCookieDescriptor(String name) Creates a newCookieDescriptordescribing the cookie with the givenname. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetName()Returns the name for the cookie.final booleanReturnstrueif the described cookie is optional, otherwisefalse.final CookieDescriptoroptional()Marks the cookie 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
-
CookieDescriptor
Creates a newCookieDescriptordescribing the cookie with the givenname.- Parameters:
name- the name
-
-
Method Details
-
optional
Marks the cookie as optional.- Returns:
this
-
getName
Returns the name for the cookie.- Returns:
- the cookie name
-
isOptional
public final boolean isOptional()Returnstrueif the described cookie is optional, otherwisefalse.- Returns:
trueif the described cookie is optional, otherwisefalse
-