Added in API level 31

Builder


class Builder
kotlin.Any
   ↳ android.app.appsearch.SearchResult.MatchInfo.Builder

Builder for MatchInfo objects.

Summary

Public constructors
Builder(propertyPath: String)

Creates a new MatchInfo.Builder reporting a match with the given property path.

Public methods
SearchResult.MatchInfo

Constructs a new MatchInfo.

SearchResult.MatchInfo.Builder

Sets the exact MatchRange corresponding to the given entry.

SearchResult.MatchInfo.Builder

Sets the snippet MatchRange corresponding to the given entry.

SearchResult.MatchInfo.Builder

Sets the submatch MatchRange corresponding to the given entry.

Public constructors

Builder

Added in API level 31
Builder(propertyPath: String)

Creates a new MatchInfo.Builder reporting a match with the given property path.

A property path is a dot-delimited sequence of property names indicating which property in the document these snippets correspond to.

Example properties: 'body', 'sender.name', 'sender.emailaddress', etc. For class example 1, this returns "subject".

Parameters
propertyPath String: A dot-delimited sequence of property names indicating which property in the document these snippets correspond to. This value cannot be null.

Public methods

build

Added in API level 31
fun build(): SearchResult.MatchInfo

Constructs a new MatchInfo.

Return
SearchResult.MatchInfo This value cannot be null.

setExactMatchRange

Added in API level 31
fun setExactMatchRange(matchRange: SearchResult.MatchRange): SearchResult.MatchInfo.Builder

Sets the exact MatchRange corresponding to the given entry.

Parameters
matchRange SearchResult.MatchRange: This value cannot be null.
Return
SearchResult.MatchInfo.Builder This value cannot be null.

setSnippetRange

Added in API level 31
fun setSnippetRange(matchRange: SearchResult.MatchRange): SearchResult.MatchInfo.Builder

Sets the snippet MatchRange corresponding to the given entry.

Parameters
matchRange SearchResult.MatchRange: This value cannot be null.
Return
SearchResult.MatchInfo.Builder This value cannot be null.

setSubmatchRange

fun setSubmatchRange(matchRange: SearchResult.MatchRange): SearchResult.MatchInfo.Builder

Sets the submatch MatchRange corresponding to the given entry.

Parameters
matchRange SearchResult.MatchRange: This value cannot be null.
Return
SearchResult.MatchInfo.Builder This value cannot be null.