Class FieldDescriptor

Direct Known Subclasses:
SubsectionDescriptor

public class FieldDescriptor extends IgnorableDescriptor<FieldDescriptor>
A description of a field found in a request or response payload.
Author:
Andreas Evers, Andy Wilkinson
See Also:
  • Constructor Details

    • FieldDescriptor

      protected FieldDescriptor(String path)
      Creates a new FieldDescriptor describing the field with the given path.
      Parameters:
      path - the path
  • Method Details

    • type

      public final FieldDescriptor type(Object type)
      Specifies the type of the field. When documenting a JSON payload, the JsonFieldType enumeration will typically be used.
      Parameters:
      type - the type of the field
      Returns:
      this
      See Also:
    • optional

      public final FieldDescriptor optional()
      Marks the field as optional.
      Returns:
      this
    • getPath

      public final String getPath()
      Returns the path of the field described by this descriptor.
      Returns:
      the path
    • getType

      public final Object getType()
      Returns the type of the field described by this descriptor.
      Returns:
      the type
    • isOptional

      public final boolean isOptional()
      Returns true if the described field is optional, otherwise false.
      Returns:
      true if the described field is optional, otherwise false