public final class

SearchResult.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.appsearch.app.SearchResult.Builder

Overview

Builder for SearchResult objects.

Summary

Constructors
publicBuilder(java.lang.String packageName, java.lang.String databaseName)

Constructs a new builder for SearchResult objects.

Methods
public SearchResult.BuilderaddMatchInfo(SearchResult.MatchInfo matchInfo)

Adds another match to this SearchResult.

public SearchResultbuild()

Constructs a new SearchResult.

public SearchResult.BuildersetDocument(java.lang.Object document)

Sets the document which matched.

public SearchResult.BuildersetGenericDocument(GenericDocument document)

Sets the document which matched.

public SearchResult.BuildersetRankingSignal(double rankingSignal)

Sets the ranking signal of the matched document in this SearchResult.

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

Constructors

public Builder(java.lang.String packageName, java.lang.String databaseName)

Constructs a new builder for SearchResult objects.

Parameters:

packageName: the package name the matched document belongs to
databaseName: the database name the matched document belongs to.

Methods

public SearchResult.Builder setDocument(java.lang.Object document)

Sets the document which matched.

Parameters:

document: An instance of a class annotated with Document.

public SearchResult.Builder setGenericDocument(GenericDocument document)

Sets the document which matched.

public SearchResult.Builder addMatchInfo(SearchResult.MatchInfo matchInfo)

Adds another match to this SearchResult.

public SearchResult.Builder setRankingSignal(double rankingSignal)

Sets the ranking signal of the matched document in this SearchResult.

public SearchResult build()

Constructs a new SearchResult.