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
ConstructorsModifierConstructorDescriptionprotectedLinkDescriptor(String rel) Creates a newLinkDescriptordescribing a link with the givenrel. -
Method Summary
Modifier and TypeMethodDescriptionfinal StringgetRel()Returns the rel of the link described by this descriptor.final booleanReturnstrueif the described link is optional, otherwisefalse.final LinkDescriptoroptional()Marks the link 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
-
LinkDescriptor
Creates a newLinkDescriptordescribing 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()Returnstrueif the described link is optional, otherwisefalse.- Returns:
trueif the described link is optional, otherwisefalse
-