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

public abstract class AbstractDescriptor<T extends AbstractDescriptor<T>> extends Object
Base class for descriptors. Provides the ability to associate arbitrary attributes with a descriptor.
Author:
Andy Wilkinson
  • Constructor Details

    • AbstractDescriptor

      public AbstractDescriptor()
  • Method Details

    • attributes

      public final T attributes(Attributes.Attribute... attributes)
      Adds the given attributes to the descriptor.
      Parameters:
      attributes - the attributes
      Returns:
      the descriptor
    • description

      public final T description(Object description)
      Specifies the description.
      Parameters:
      description - the description
      Returns:
      the descriptor
    • getDescription

      public final Object getDescription()
      Returns the description.
      Returns:
      the description
    • getAttributes

      public final Map<String,Object> getAttributes()
      Returns the descriptor's attributes.
      Returns:
      the attributes