public GenericRequestBuilder<ModelType, DataType, ResourceType, TranscodeType> encoder(
            ResourceEncoder<ResourceType> encoder) {
        // loadProvider will be null if model is null, in which case we're not going to load anything so it's ok to
        // ignore the encoder.
        if (loadProvider != null) {
            loadProvider.setEncoder(encoder);
        }

        return this;
    }
Sets the {@link Encoder} to use to encode the original data directly to cache. Will only
be used if the original data is not already in cache and if the
{@link DiskCacheStrategy} is set to
{@link DiskCacheStrategy#SOURCE} or
{@link DiskCacheStrategy#ALL}.

@see #sourceEncoder(Encoder)
@see DiskCacheStrategy

@param encoder The encoder to use.
@return This request builder.
core/src/main/java/com/bumptech/glide/GenericRequestBuilder.java