public class TranscoderRegistry extends Object
ResourceTranscoder
s to be
registered and retrieved by the classes they convert between.Constructor and Description |
---|
TranscoderRegistry() |
Modifier and Type | Method and Description |
---|---|
<Z,R> ResourceTranscoder<Z,R> |
get(Class<Z> resourceClass,
Class<R> transcodedClass)
Returns the currently registered
ResourceTranscoder for the given classes. |
<Z,R> List<Class<R>> |
getTranscodeClasses(Class<Z> resourceClass,
Class<R> transcodeClass) |
<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. |
public <Z,R> void register(@NonNull Class<Z> decodedClass, @NonNull Class<R> transcodedClass, @NonNull ResourceTranscoder<Z,R> transcoder)
ResourceTranscoder
using
the given classes so it can later be retrieved using the given classes.Z
- The type of the resource that the transcoder transcodes from.R
- The type of the resource that the transcoder transcodes to.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.@NonNull public <Z,R> ResourceTranscoder<Z,R> get(@NonNull Class<Z> resourceClass, @NonNull Class<R> transcodedClass)
ResourceTranscoder
for the given classes.Z
- The type of the resource that the transcoder transcodes from.R
- The type of the resource that the transcoder transcodes to.resourceClass
- The class of the resource that the transcoder transcodes from.transcodedClass
- The class of the resource that the transcoder transcodes to.