public final class

ObserverSpec.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.observer.ObserverSpec.Builder

Overview

Builder for ObserverSpec instances.

Summary

Constructors
publicBuilder()

Methods
public ObserverSpec.BuilderaddFilterDocumentClasses(java.lang.Class<java.lang.Object> documentClasses[])

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

public ObserverSpec.BuilderaddFilterDocumentClasses(java.util.Collection<java.lang.Class> documentClasses)

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

public ObserverSpec.BuilderaddFilterSchemas(java.util.Collection<java.lang.String> schemas)

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

public ObserverSpec.BuilderaddFilterSchemas(java.lang.String schemas[])

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

public ObserverSpecbuild()

Constructs a new ObserverSpec from the contents of this builder.

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

Constructors

public Builder()

Methods

public ObserverSpec.Builder addFilterSchemas(java.lang.String schemas[])

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

If unset, the observer will match documents of all types.

public ObserverSpec.Builder addFilterSchemas(java.util.Collection<java.lang.String> schemas)

Restricts an observer using this spec to triggering only for documents of one of the provided schema types.

If unset, the observer will match documents of all types.

public ObserverSpec.Builder addFilterDocumentClasses(java.lang.Class<java.lang.Object> documentClasses[])

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

If unset, the observer will match documents of all types.

Merged list available from ObserverSpec.getFilterSchemas().

Parameters:

documentClasses: classes annotated with Document.

public ObserverSpec.Builder addFilterDocumentClasses(java.util.Collection<java.lang.Class> documentClasses)

Restricts an observer using this spec to triggering only for documents of one of the provided document classes.

If unset, the observer will match documents of all types.

Merged list available from ObserverSpec.getFilterSchemas().

Parameters:

documentClasses: classes annotated with Document.

public ObserverSpec build()

Constructs a new ObserverSpec from the contents of this builder.