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, getAttributesprotected 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 fieldthisJsonFieldTypepublic final FieldDescriptor optional()
thispublic final FieldDescriptor description(String description)
description - The field's descriptionthispublic final String getPath()
public final Object getType()
public final boolean isOptional()
true if the described field is optional, otherwise falsetrue if the described field is optional, otherwise falsepublic final String getDescription()