DATACOUCH-86 - Implement Spring4 cache get with cast.
This changeset extends the CouchbaseCache to be compatible with the newly added method of the Spring 4 cache interface.
This commit is contained in:
@@ -81,6 +81,12 @@ public class CouchbaseCache implements Cache {
|
||||
return (result != null ? new SimpleValueWrapper(result) : null);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public final <T> T get(final Object key, final Class<T> clazz) {
|
||||
String documentId = key.toString();
|
||||
return (T) client.get(documentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a object in Couchbase.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user