AppInitializer


public final class AppInitializer


An AppInitializer can be used to initialize all discovered ComponentInitializers. The discovery mechanism is via <meta-data> entries in the merged AndroidManifest.xml.

Summary

Public methods

static @NonNull AppInitializer
@NonNull T

Initializes a Initializer class type.

boolean

Returns true if the Initializer was eagerly initialized..

Public methods

getInstance

Added in 1.0.0
public static @NonNull AppInitializer getInstance(@NonNull Context context)
Parameters
@NonNull Context context

The Application Context

Returns
@NonNull AppInitializer

The instance of AppInitializer after initialization.

initializeComponent

Added in 1.0.0
public @NonNull T <T> initializeComponent(@NonNull Class<Initializer<T>> component)

Initializes a Initializer class type.

Parameters
<T>

The instance type being initialized

@NonNull Class<Initializer<T>> component

The Class of Initializer to initialize.

Returns
@NonNull T

The initialized instance

isEagerlyInitialized

Added in 1.0.0
public boolean isEagerlyInitialized(@NonNull Class<Initializer<Object>> component)

Returns true if the Initializer was eagerly initialized..

Parameters
@NonNull Class<Initializer<Object>> component

The Initializer class to check

Returns
boolean

true if the Initializer was eagerly initialized.