android-components / mozilla.components.support.base.facts.processor / CollectionProcessor

CollectionProcessor

class CollectionProcessor : FactProcessor (source)

A FactProcessor implementation that keeps all Fact objects in a list.

This FactProcessor is only for testing.

Constructors

Name Summary
<init> CollectionProcessor()
A FactProcessor implementation that keeps all Fact objects in a list.

Properties

Name Summary
facts val facts: List<Fact>

Functions

Name Summary
process fun process(fact: Fact): Unit
Passes the given Fact to the FactProcessor for processing.

Companion Object Functions

Name Summary
withFactCollection fun withFactCollection(block: (List<Fact>) -> Unit): Unit
Helper for creating a CollectionProcessor, registering it and clearing the processors again.

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.
register fun FactProcessor.register(): Facts
Registers this FactProcessor to collect Fact instances from the Facts singleton.