Initializer

open class Initializer<P : AnyPanel, F : IviFragment<P, *>>(val fragment: F, panel: P)

Wrapper used to pass a fragment that is guaranteed to be initialized properly.

This is essentially a helper class that prevents engineers from accidentally forgetting to initialize a fragment after creating it. It removes the necessity of solving this through generics alone, as that requires a lot of recurring clutter or would result in the loss of type-safety.

Parameters

P

The type of the panel that the fragment relies on as its host.

fragment

The fragment to be initialized.

panel

The panel that hosts the fragment.

Constructors

Link copied to clipboard
fun <P : AnyPanel, F : IviFragment<P, *>> Initializer(fragment: F, panel: P)

Properties

Link copied to clipboard
val fragment: F