T
- The type of the resource that will always fail to be encoded.public class NullResourceEncoder<T> extends Object implements ResourceEncoder<T>
ResourceEncoder
that never writes data.Constructor and Description |
---|
NullResourceEncoder() |
Modifier and Type | Method and Description |
---|---|
boolean |
encode(Resource<T> data,
OutputStream os)
Writes the given data to the given output stream and returns True if the write completed successfully and
should be committed.
|
static <T> NullResourceEncoder<T> |
get()
Returns a NullResourceEncoder for the given type.
|
String |
getId()
Returns an ID identifying any transformation this encoder may apply to the given data that will be mixed in to
the cache key.
|
public static <T> NullResourceEncoder<T> get()
T
- The type of data to be written (or in this case not written).public boolean encode(Resource<T> data, OutputStream os)
Encoder
public String getId()
Encoder
If the encoder does not transform the data in a way that significantly affects the cached result (ie performs no unusual compression or downsampling) an empty string is an appropriate id.