T
- The type of the model the ModelLoader
s built by
this factory can handleY
- The type of data the ModelLoader
s built by this
factory can load.public interface ModelLoaderFactory<T,Y>
ModelLoader
for a given model type.
The application Context
can be passed in to the constructor of the
factory when necessary. It's unsafe to retain Activity
Context
s in factories. The Context
can be obtained from
LibraryGlideModule.registerComponents(Context, Glide, Registry)
in most cases.
Modifier and Type | Method and Description |
---|---|
ModelLoader<T,Y> |
build(MultiModelLoaderFactory multiFactory)
Build a concrete ModelLoader for this model type.
|
void |
teardown()
A lifecycle method that will be called when this factory is about to replaced.
|
@NonNull ModelLoader<T,Y> build(@NonNull MultiModelLoaderFactory multiFactory)
multiFactory
- A map of classes to factories that can be used to construct additional
ModelLoader
s that this factory's ModelLoader
may depend onModelLoader
void teardown()