com.bumptech.glide.load.resource.transcode
Class TranscoderRegistry

java.lang.Object
  extended by com.bumptech.glide.load.resource.transcode.TranscoderRegistry

public class TranscoderRegistry
extends Object

A class that allows ResourceTranscoders to be registered and retrieved by the classes they convert between.


Constructor Summary
TranscoderRegistry()
           
 
Method Summary
<Z,R> ResourceTranscoder<Z,R>
get(Class<Z> decodedClass, Class<R> transcodedClass)
          Returns the currently registered ResourceTranscoder for the given classes.
<Z,R> void
register(Class<Z> decodedClass, Class<R> transcodedClass, ResourceTranscoder<Z,R> transcoder)
          Registers the given ResourceTranscoder using the given classes so it can later be retrieved using the given classes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TranscoderRegistry

public TranscoderRegistry()
Method Detail

register

public <Z,R> void register(Class<Z> decodedClass,
                           Class<R> transcodedClass,
                           ResourceTranscoder<Z,R> transcoder)
Registers the given ResourceTranscoder using the given classes so it can later be retrieved using the given classes.

Type Parameters:
Z - The type of the resource that the transcoder transcodes from.
R - The type of the resource that the transcoder transcodes to.
Parameters:
decodedClass - The class of the resource that the transcoder transcodes from.
transcodedClass - The class of the resource that the transcoder transcodes to.
transcoder - The transcoder.

get

public <Z,R> ResourceTranscoder<Z,R> get(Class<Z> decodedClass,
                                         Class<R> transcodedClass)
Returns the currently registered ResourceTranscoder for the given classes.

Type Parameters:
Z - The type of the resource that the transcoder transcodes from.
R - The type of the resource that the transcoder transcodes to.
Parameters:
decodedClass - The class of the resource that the transcoder transcodes from.
transcodedClass - The class of the resource that the transcoder transcodes to.