Document.LongProperty
@Documented
@Retention(value = RetentionPolicy.CLASS)
@Target(value = [ElementType.FIELD, ElementType.METHOD])
public annotation Document.LongProperty
Configures a 64-bit integer field of a class as a property known to AppSearch.
Summary
Nested types |
|---|
public final class Document.LongProperty.DefaultSerializer implements LongSerializer |
Public methods |
|
|---|---|
abstract int |
Configures how a property should be indexed so that it can be retrieved by queries. |
abstract String |
name()The name of this property. |
abstract boolean |
required()Configures whether this property must be specified for the document to be valid. |
abstract Class<LongSerializer<Object>> |
Configures how a property should be converted to and from a |
Public methods
indexingType
public abstract int indexingType()
Configures how a property should be indexed so that it can be retrieved by queries.
If not specified, defaults to INDEXING_TYPE_NONE (the field will not be indexed and cannot be queried).
name
public abstract String name()
The name of this property. This string is used to query against this property.
If not specified, the name of the field in the code will be used instead.
required
public abstract boolean required()
Configures whether this property must be specified for the document to be valid.
This attribute does not apply to properties of a repeated type (e.g. a list).
Please make sure you understand the consequences of required fields on schema migration before setting this attribute to true.
serializer
public abstract Class<LongSerializer<Object>> serializer()
Configures how a property should be converted to and from a Long.
Useful for representing properties using rich types that boil down to simple 64-bit integer values in the database.
The referenced class must have a public zero params constructor.
See serializer for an example of a serializer.