android-components / mozilla.components.browser.awesomebar.transform / SuggestionTransformer

SuggestionTransformer

interface SuggestionTransformer (source)

A SuggestionTransformer takes an input list of AwesomeBar.Suggestion and returns a new list of transformed [AwesomeBar.Suggestion| objects.

A SuggestionTransformer can be used to adding data, removing data or filtering suggestions:

Functions

Name Summary
transform abstract fun transform(provider: SuggestionProvider, suggestions: List<Suggestion>): List<Suggestion>
Takes a list of AwesomeBar.Suggestion object and the AwesomeBar.SuggestionProvider instance that emitted the suggestions in order to return a transformed list of AwesomeBar.Suggestion objects.

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.