public abstract class

AppSearchSchema.PropertyConfig

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.app.AppSearchSchema.PropertyConfig

Subclasses:

AppSearchSchema.StringPropertyConfig, AppSearchSchema.LongPropertyConfig, AppSearchSchema.DoublePropertyConfig, AppSearchSchema.BooleanPropertyConfig, AppSearchSchema.BytesPropertyConfig, AppSearchSchema.DocumentPropertyConfig, AppSearchSchema.EmbeddingPropertyConfig

Overview

Common configuration for a single property (field) in a Document.

For example, an EmailMessage would be a type and the subject would be a property.

Summary

Fields
public static final intCARDINALITY_OPTIONAL

Zero or one value [0,1].

public static final intCARDINALITY_REPEATED

Any number of items (including zero) [0...*].

public static final intCARDINALITY_REQUIRED

Exactly one value [1].

public static final intDATA_TYPE_BOOLEAN

Constant value for Boolean data type.

public static final intDATA_TYPE_BYTES

Unstructured BLOB.

public static final intDATA_TYPE_DOCUMENT

Indicates that the property is itself a GenericDocument, making it part of a hierarchical schema.

public static final intDATA_TYPE_DOUBLE

Constant value for Double data type.

public static final intDATA_TYPE_EMBEDDING

Indicates that the property is an EmbeddingVector.

public static final intDATA_TYPE_LONG

Constant value for Long data type.

public static final intDATA_TYPE_STRING

Constant value for String data type.

Methods
public booleanequals(java.lang.Object other)

public static AppSearchSchema.PropertyConfigfromParcel(PropertyConfigParcel propertyConfigParcel)

Converts a into a AppSearchSchema.PropertyConfig depending on its internal data type.

public intgetCardinality()

Returns the cardinality of the property (whether it is optional, required or repeated).

public intgetDataType()

Returns the type of data the property contains (such as string, int, bytes, etc).

public java.lang.StringgetDescription()

Returns a natural language description of this property.

public java.lang.StringgetName()

Returns the name of this property.

public inthashCode()

public java.lang.StringtoString()

from java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait

Fields

public static final int DATA_TYPE_STRING

Constant value for String data type.

public static final int DATA_TYPE_LONG

Constant value for Long data type.

public static final int DATA_TYPE_DOUBLE

Constant value for Double data type.

public static final int DATA_TYPE_BOOLEAN

Constant value for Boolean data type.

public static final int DATA_TYPE_BYTES

Unstructured BLOB.

public static final int DATA_TYPE_DOCUMENT

Indicates that the property is itself a GenericDocument, making it part of a hierarchical schema. Any property using this DataType MUST have a valid AppSearchSchema.getSchemaType().

public static final int DATA_TYPE_EMBEDDING

Indicates that the property is an EmbeddingVector.

public static final int CARDINALITY_REPEATED

Any number of items (including zero) [0...*].

public static final int CARDINALITY_OPTIONAL

Zero or one value [0,1].

public static final int CARDINALITY_REQUIRED

Exactly one value [1].

Methods

public java.lang.String toString()

public java.lang.String getName()

Returns the name of this property.

public java.lang.String getDescription()

Returns a natural language description of this property.

Ex. The description for the "homeAddress" property of a "Person" type could be "the address at which this person lives".

This information is purely to help apps consuming this type the semantic meaning of its properties. This field has no effect in AppSearch - it is just stored with the AppSearchSchema. If the description is not set, then this method will return an empty string.

public int getDataType()

Returns the type of data the property contains (such as string, int, bytes, etc).

public int getCardinality()

Returns the cardinality of the property (whether it is optional, required or repeated).

public boolean equals(java.lang.Object other)

public int hashCode()

public static AppSearchSchema.PropertyConfig fromParcel(PropertyConfigParcel propertyConfigParcel)

Converts a into a AppSearchSchema.PropertyConfig depending on its internal data type.

The bundle is not cloned.