Annotation Interface Field
Annotation to define custom metadata for document fields.
- Author:
- Oliver Gierke, Christoph Strobl, Divya Srivastava
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of write strategies to define when a property is included for write conversion. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe key to be used to store the field inside the document.int
The order in which various fields shall be stored.The actual desired target type the field should be stored as.The key to be used to store the field inside the document.Write rules when to include a property value upon conversion.
-
Element Details
-
value
The key to be used to store the field inside the document. Alias forname()
.- Returns:
- an empty
String
by default.
- Default:
- ""
-
name
The key to be used to store the field inside the document. Alias forvalue()
.- Returns:
- an empty
String
by default. - Since:
- 2.2
- Default:
- ""
-
order
int orderThe order in which various fields shall be stored. Has to be a positive integer.- Returns:
- the order the field shall have in the document or -1 if undefined.
- Default:
- 2147483647
-
targetType
FieldType targetTypeThe actual desired target type the field should be stored as.- Returns:
FieldType.IMPLICIT
by default.- Since:
- 2.2
- Default:
- IMPLICIT
-
write
Field.Write writeWrite rules when to include a property value upon conversion. If set toField.Write.NON_NULL
(default) null values are not written to the targetDocument
. Setting the value toField.Write.ALWAYS
explicitly adds an entry for the given field holding null as a value'fieldName' : null
.
NOTESetting the value toField.Write.ALWAYS
may lead to increased document size.- Returns:
Field.Write.NON_NULL
by default.- Since:
- 3.3
- Default:
- NON_NULL
-