SearchResult.MatchInfo.Builder


public final class SearchResult.MatchInfo.Builder


Builder for MatchInfo objects.

Summary

Public constructors

Builder(@NonNull String propertyPath)

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

Public methods

@NonNull SearchResult.MatchInfo

Constructs a new MatchInfo.

@NonNull SearchResult.MatchInfo.Builder

Sets the exact MatchRange corresponding to the given entry.

@NonNull SearchResult.MatchInfo.Builder

Sets the snippet MatchRange corresponding to the given entry.

@NonNull SearchResult.MatchInfo.Builder

Sets the start and end of a submatch MatchRange corresponding to the given entry.

Public constructors

Builder

Added in 1.1.0-alpha06
public Builder(@NonNull String propertyPath)

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
@NonNull String propertyPath

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

Public methods

build

Added in 1.1.0-alpha06
public @NonNull SearchResult.MatchInfo build()

Constructs a new MatchInfo.

setExactMatchRange

Added in 1.1.0-alpha06
public @NonNull SearchResult.MatchInfo.Builder setExactMatchRange(@NonNull SearchResult.MatchRange matchRange)

Sets the exact MatchRange corresponding to the given entry.

setSnippetRange

Added in 1.1.0-alpha06
public @NonNull SearchResult.MatchInfo.Builder setSnippetRange(@NonNull SearchResult.MatchRange matchRange)

Sets the snippet MatchRange corresponding to the given entry.

setSubmatchRange

Added in 1.1.0-alpha06
public @NonNull SearchResult.MatchInfo.Builder setSubmatchRange(@NonNull SearchResult.MatchRange matchRange)

Sets the start and end of a submatch MatchRange corresponding to the given entry.