Interface ResourceDecoder<T>
- Type Parameters:
T- The concrete type this decoder needs to decode
public interface ResourceDecoder<T>
Implement this interface to pass to
PreprocessChain.loadWith(ResourceDecoder) for custom resource loading behavior.-
Method Details
-
decode
T decode(android.content.Context context, Payload payload) throws PayloadNotFoundException, PayloadDecodeExceptionPrepare the resource for preprocessing. This method should extract a concrete resource with type T from the generic payload. T is later passed on toPreprocess.execute(Context, Object)down the chain.- Parameters:
context- Android context.payload- Payload to extract the resource from- Returns:
- The extract concrete resource of type T
- Throws:
PayloadNotFoundException- If the given payload could not be found.PayloadDecodeException- If the given payload could not be properly decoded.
-