Class LinkDescriptor
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<T>
org.springframework.restdocs.snippet.IgnorableDescriptor<LinkDescriptor>
org.springframework.restdocs.hypermedia.LinkDescriptor
A description of a link found in a hypermedia API.
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionprotected
LinkDescriptor
(String rel) Creates a newLinkDescriptor
describing a link with the givenrel
. -
Method Summary
Modifier and TypeMethodDescriptionfinal String
getRel()
Returns the rel of the link described by this descriptor.final boolean
Returnstrue
if the described link is optional, otherwisefalse
.final LinkDescriptor
optional()
Marks the link 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
-
LinkDescriptor
Creates a newLinkDescriptor
describing a link with the givenrel
.- Parameters:
rel
- the rel of the link
-
-
Method Details
-
optional
Marks the link as optional.- Returns:
this
-
getRel
Returns the rel of the link described by this descriptor.- Returns:
- the rel
-
isOptional
public final boolean isOptional()Returnstrue
if the described link is optional, otherwisefalse
.- Returns:
true
if the described link is optional, otherwisefalse
-