public final class

GenericDocumentParcel.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.safeparcel.GenericDocumentParcel.Builder

Overview

The builder class for GenericDocumentParcel.

Summary

Constructors
publicBuilder(GenericDocumentParcel documentSafeParcel)

Creates a new GenericDocumentParcel.Builder from the given GenericDocumentParcel.

publicBuilder(java.lang.String namespace, java.lang.String id, java.lang.String schemaType)

Creates a new GenericDocumentParcel.Builder.

Methods
public GenericDocumentParcelbuild()

Builds the GenericDocument object.

public GenericDocumentParcel.BuilderclearProperty(java.lang.String name)

Clears the value for the property with the given name.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, boolean[] values[])

puts an array of boolean in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, byte[][] values[][])

Converts and saves a byte[][] into GenericDocumentParcel.mProperties.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, double[] values[])

puts an array of double in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, EmbeddingVector values[])

puts an array of EmbeddingVector in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, GenericDocumentParcel values[])

puts an array of GenericDocumentParcel in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, long[] values[])

puts an array of long in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, PropertyParcel value)

Directly puts a PropertyParcel in property map.

public GenericDocumentParcel.BuilderputInPropertyMap(java.lang.String name, java.lang.String values[])

puts an array of java.lang.String in property map.

public GenericDocumentParcel.BuildersetCreationTimestampMillis(long creationTimestampMillis)

Sets the creation timestamp of the GenericDocument, in milliseconds.

public GenericDocumentParcel.BuildersetId(java.lang.String id)

Sets the ID of this document, changing the value provided in the constructor.

public GenericDocumentParcel.BuildersetNamespace(java.lang.String namespace)

Sets the app-defined namespace this document resides in, changing the value provided in the constructor.

public GenericDocumentParcel.BuildersetParentTypes(java.util.List<java.lang.String> parentTypes)

Sets the list of parent types of the GenericDocument's type.

public GenericDocumentParcel.BuildersetSchemaType(java.lang.String schemaType)

Sets the schema type of this document, changing the value provided in the constructor.

public GenericDocumentParcel.BuildersetScore(int score)

Sets the score of the parent GenericDocument.

public GenericDocumentParcel.BuildersetTtlMillis(long ttlMillis)

Sets the TTL (time-to-live) of the GenericDocument, in milliseconds.

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder(java.lang.String namespace, java.lang.String id, java.lang.String schemaType)

Creates a new GenericDocumentParcel.Builder.

Document IDs are unique within a namespace.

The number of namespaces per app should be kept small for efficiency reasons.

public Builder(GenericDocumentParcel documentSafeParcel)

Creates a new GenericDocumentParcel.Builder from the given GenericDocumentParcel.

Methods

public GenericDocumentParcel.Builder setNamespace(java.lang.String namespace)

Sets the app-defined namespace this document resides in, changing the value provided in the constructor. No special values are reserved or understood by the infrastructure.

Document IDs are unique within a namespace.

The number of namespaces per app should be kept small for efficiency reasons.

public GenericDocumentParcel.Builder setId(java.lang.String id)

Sets the ID of this document, changing the value provided in the constructor. No special values are reserved or understood by the infrastructure.

Document IDs are unique within a namespace.

public GenericDocumentParcel.Builder setSchemaType(java.lang.String schemaType)

Sets the schema type of this document, changing the value provided in the constructor.

To successfully index a document, the schema type must match the name of an AppSearchSchema object previously provided to AppSearchSession.

public GenericDocumentParcel.Builder setScore(int score)

Sets the score of the parent GenericDocument.

public GenericDocumentParcel.Builder setCreationTimestampMillis(long creationTimestampMillis)

Sets the creation timestamp of the GenericDocument, in milliseconds.

This should be set using a value obtained from the currentTimeMillis time base.

If this method is not called, this will be set to the time the object is built.

Parameters:

creationTimestampMillis: a creation timestamp in milliseconds.

public GenericDocumentParcel.Builder setTtlMillis(long ttlMillis)

Sets the TTL (time-to-live) of the GenericDocument, in milliseconds.

The TTL is measured against GenericDocumentParcel.getCreationTimestampMillis(). At the timestamp of creationTimestampMillis + ttlMillis, measured in the currentTimeMillis time base, the document will be auto-deleted.

The default value is 0, which means the document is permanent and won't be auto-deleted until the app is uninstalled or AppSearchSession is called.

Parameters:

ttlMillis: a non-negative duration in milliseconds.

public GenericDocumentParcel.Builder setParentTypes(java.util.List<java.lang.String> parentTypes)

Sets the list of parent types of the GenericDocument's type.

Child types must appear before parent types in the list.

public GenericDocumentParcel.Builder clearProperty(java.lang.String name)

Clears the value for the property with the given name.

Note that this method does not support property paths.

Parameters:

name: The name of the property to clear.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, java.lang.String values[])

puts an array of java.lang.String in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, boolean[] values[])

puts an array of boolean in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, double[] values[])

puts an array of double in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, long[] values[])

puts an array of long in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, byte[][] values[][])

Converts and saves a byte[][] into GenericDocumentParcel.mProperties.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, GenericDocumentParcel values[])

puts an array of GenericDocumentParcel in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, EmbeddingVector values[])

puts an array of EmbeddingVector in property map.

public GenericDocumentParcel.Builder putInPropertyMap(java.lang.String name, PropertyParcel value)

Directly puts a PropertyParcel in property map.

public GenericDocumentParcel build()

Builds the GenericDocument object.