android-components / mozilla.components.support.base.facts / Fact

Fact

data class Fact (source)

A fact describing a generic event that has occurred in a component.

Constructors

Name Summary
<init> Fact(component: <ERROR CLASS>, action: Action, item: String, value: String? = null, metadata: Map<String, Any>? = null)
A fact describing a generic event that has occurred in a component.

Properties

Name Summary
action val action: Action
A user or system action that caused this fact (e.g. Action.CLICK).
component val component: <ERROR CLASS>
Component that emitted this fact.
item val item: String
An item that caused the action or that the action was performed on (e.g. “toolbar”).
metadata val metadata: Map<String, Any>?
A key/value map for facts where additional richer context is needed.
value val value: String?
An optional value providing more context.

Extension Functions

Name Summary
collect fun Fact.collect(): Unit
Collect this fact through the Facts singleton.
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.