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:
Michael Nitschinger
2014-05-19 12:09:15 +02:00
parent 817e112f66
commit a2cd30af3e
2 changed files with 27 additions and 0 deletions

View File

@@ -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.
*