FactoryProvider

interface FactoryProvider

Used to provide various factories from the backend for static factory functions.

Functions

Link copied to clipboard
abstract fun <T> provide(type: Class<T>): T

Provides the factory with the given type type, or throws a TypeNotFoundException if there is no factory registered for the given type.

Link copied to clipboard
inline fun <T> FactoryProvider.provide(): T

Provides the factory with the given type T, or throws a TypeNotFoundException if there is no factory registered for the given type.

Link copied to clipboard
abstract fun <T> register(type: Class<T>, factory: T)

Registers the given factory of the given type to this factory provider.

Link copied to clipboard
inline fun <T> FactoryProvider.register(factory: T)

Registers the given factory of the given type T to this factory provider.