Class AbstractDescriptor<T extends AbstractDescriptor<T>>
java.lang.Object
org.springframework.restdocs.snippet.AbstractDescriptor<T>
- Type Parameters:
T
- the type of the descriptor
- Direct Known Subclasses:
HeaderDescriptor
,IgnorableDescriptor
Base class for descriptors. Provides the ability to associate arbitrary attributes with
a descriptor.
- Author:
- Andy Wilkinson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal T
attributes
(Attributes.Attribute... attributes) Adds the givenattributes
to the descriptor.final T
description
(Object description) Specifies the description.Returns the descriptor's attributes.final Object
Returns the description.
-
Constructor Details
-
AbstractDescriptor
public AbstractDescriptor()
-
-
Method Details
-
attributes
Adds the givenattributes
to the descriptor.- Parameters:
attributes
- the attributes- Returns:
- the descriptor
-
description
Specifies the description.- Parameters:
description
- the description- Returns:
- the descriptor
-
getDescription
Returns the description.- Returns:
- the description
-
getAttributes
Returns the descriptor's attributes.- Returns:
- the attributes
-