append

open fun <Data> append(dataClass: Class<Data>, encoder: Encoder<Data>): Registry

Appends the given Encoder onto the list of available Encoders so that it is attempted after all earlier and default Encoders for the given data class.

The Encoder will be used both for the exact data class and any subtypes. For example, registering an Encoder for java.io.InputStream will result in the Encoder being used for , java.io.FileInputStream and any other subclass.

If multiple Encoders are registered for the same type or super type, the that is registered first will be used.

See also


open fun <Data, TResource> append(    dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry

Appends the given ResourceDecoder onto the list of all available s allowing it to be used if all earlier and default ResourceDecoders for the given types fail (or there are none).

If you're attempting to replace an existing ResourceDecoder or would like to ensure that your ResourceDecoder gets the chance to run before an existing , use prepend. This method is best for new types of resources and data or as a way to add an additional fallback decoder for an existing type of data.

See also

Parameters

dataClass

The data that will be decoded from (java.io.InputStream, etc).

resourceClass

The resource that will be decoded to (android.graphics.Bitmap, com.bumptech.glide.load.resource.gif.GifDrawable etc).

decoder

The ResourceDecoder to register.


open fun <Data, TResource> append(    bucket: String,     dataClass: Class<Data>,     resourceClass: Class<TResource>,     decoder: ResourceDecoder<Data, TResource>): Registry

Appends the given ResourceDecoder onto the list of available ResourceDecoders in this bucket, allowing it to be used if all earlier and default ResourceDecoders for the given types in this bucket fail (or there are none).

If you're attempting to replace an existing ResourceDecoder or would like to ensure that your ResourceDecoder gets the chance to run before an existing , use prepend. This method is best for new types of resources and data or as a way to add an additional fallback decoder for an existing type of data.

See also

Parameters

bucket

The bucket identifier to add this decoder to.

dataClass

The data that will be decoded from (java.io.InputStream, etc).

resourceClass

The resource that will be decoded to (android.graphics.Bitmap, com.bumptech.glide.load.resource.gif.GifDrawable etc).

decoder

The ResourceDecoder to register.


open fun <TResource> append(resourceClass: Class<TResource>, encoder: ResourceEncoder<TResource>): Registry

Appends the given ResourceEncoder into the list of available ResourceEncoders so that it is attempted after all earlier and default ResourceEncoders for the given data type.

The ResourceEncoder will be used both for the exact resource class and any subtypes. For example, registering an ResourceEncoder for (not recommended) will result in the being used for android.graphics.drawable.BitmapDrawable and and any other subclass.

If multiple ResourceEncoders are registered for the same type or super type, the ResourceEncoder that is registered first will be used.

See also


open fun <Model, Data> append(    modelClass: Class<Model>,     dataClass: Class<Data>,     factory: ModelLoaderFactory<Model, Data>): Registry

Appends a new ModelLoaderFactory onto the end of the existing set so that the constructed ModelLoader will be tried after all default and previously registered ModelLoaders for the given model and data classes.

If you're attempting to replace an existing ModelLoader, use prepend. 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.

If multiple ModelLoaderFactorys are registered for the same model and/or data classes, the ModelLoaders they produce will be attempted in the order the s were registered. Only if all ModelLoaders fail will the entire request fail.

See also

Parameters

modelClass

The model class (e.g. URL, file path).

dataClass

the data class (e.g. java.io.InputStream, ).