/** * Appends a new {@link ModelLoaderFactory} onto the end of the existing set so that the * constructed {@link ModelLoader} will be tried after all default and previously registered * {@link ModelLoader}s for the given model and data classes. * * <p>If you're attempting to replace an existing {@link ModelLoader}, use * {@link #prepend(Class, Class, ModelLoaderFactory)}. This method is best for new types of models * and/or data or as a way to add an additional fallback loader for an existing type of * model/data. * * <p>If multiple {@link ModelLoaderFactory}s are registered for the same model and/or data * classes, the {@link ModelLoader}s they produce will be attempted in the order the * {@link ModelLoaderFactory}s were registered. Only if all {@link ModelLoader}s fail will the * entire request fail. * * @see #prepend(Class, Class, ModelLoaderFactory) * @see #replace(Class, Class, ModelLoaderFactory) * * @param modelClass The model class (e.g. URL, file path). * @param dataClass the data class (e.g. {@link java.io.InputStream}, * {@link java.io.FileDescriptor}). */ @NonNull public <Model, Data> Registry append( @NonNull Class<Model> modelClass, @NonNull Class<Data> dataClass, @NonNull ModelLoaderFactory<Model, Data> factory) { modelLoaderRegistry.append(modelClass, dataClass, factory); return this; }
/** * Appends a new {@link ModelLoaderFactory} onto the end of the existing set so that the * constructed {@link ModelLoader} will be tried after all default and previously registered * {@link ModelLoader}s for the given model and data classes. * * <p>If you're attempting to replace an existing {@link ModelLoader}, use * {@link #prepend(Class, Class, ModelLoaderFactory)}. This method is best for new types of models * and/or data or as a way to add an additional fallback loader for an existing type of * model/data. * * <p>If multiple {@link ModelLoaderFactory}s are registered for the same model and/or data * classes, the {@link ModelLoader}s they produce will be attempted in the order the * {@link ModelLoaderFactory}s were registered. Only if all {@link ModelLoader}s fail will the * entire request fail. * * @see #prepend(Class, Class, ModelLoaderFactory) * @see #replace(Class, Class, ModelLoaderFactory) * * @param modelClass The model class (e.g. URL, file path). * @param dataClass the data class (e.g. {@link java.io.InputStream}, * {@link java.io.FileDescriptor}). */ public <Model, Data> Registry append(Class<Model> modelClass, Class<Data> dataClass, ModelLoaderFactory<Model, Data> factory) { modelLoaderRegistry.append(modelClass, dataClass, factory); return this; }