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(SearchResult searchResult)

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

Constructs a new builder for SearchResult objects.

Methods
public SearchResult.BuilderaddInformationalRankingSignal(double rankingSignal)

Adds the informational ranking signal of the matched document in this SearchResult.

public SearchResult.BuilderaddJoinedResult(SearchResult joinedResult)

Adds a SearchResult that was joined by the JoinSpec.

public SearchResult.BuilderaddMatchInfo(SearchResult.MatchInfo matchInfo)

Adds another match to this SearchResult.

public SearchResultbuild()

Constructs a new SearchResult.

public SearchResult.BuilderclearJoinedResults()

Clears the SearchResults that were joined.

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.

public Builder(SearchResult searchResult)

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.Builder addInformationalRankingSignal(double rankingSignal)

Adds the informational ranking signal of the matched document in this SearchResult.

public SearchResult.Builder addJoinedResult(SearchResult joinedResult)

Adds a SearchResult that was joined by the JoinSpec.

Parameters:

joinedResult: The joined SearchResult to add.

public SearchResult.Builder clearJoinedResults()

Clears the SearchResults that were joined.

public SearchResult build()

Constructs a new SearchResult.