public class FieldDescriptor extends AbstractDescriptor<FieldDescriptor>
PayloadDocumentation.fieldWithPath(String)
Modifier | Constructor and Description |
---|---|
protected |
FieldDescriptor(String path)
Creates a new
FieldDescriptor describing the field with the given
path . |
Modifier and Type | Method and Description |
---|---|
FieldDescriptor |
description(String description)
Specifies the description of the field
|
String |
getDescription()
Returns the description for the field
|
String |
getPath()
Returns the path of the field described by this descriptor
|
Object |
getType()
Returns the type of the field described by this descriptor
|
boolean |
isOptional()
Returns
true if the described field is optional, otherwise false |
FieldDescriptor |
optional()
Marks the field as optional
|
FieldDescriptor |
type(Object type)
Specifies the type of the field.
|
attributes, getAttributes
protected FieldDescriptor(String path)
FieldDescriptor
describing the field with the given
path
.path
- the pathpublic final FieldDescriptor type(Object type)
JsonFieldType
enumeration will typically be used.type
- The type of the fieldthis
JsonFieldType
public final FieldDescriptor optional()
this
public final FieldDescriptor description(String description)
description
- The field's descriptionthis
public final String getPath()
public final Object getType()
public final boolean isOptional()
true
if the described field is optional, otherwise false
true
if the described field is optional, otherwise false
public final String getDescription()