@Override
public Result execute(Session session) {
Cache<Object, Object> cache = session.getCache(keyData.getCacheName());
Object value = cache.get(keyData.key);
if (value==null) {
return new StringResult("null");
} else if (value instanceof String) {
return new StringResult((String)value);
} else if (value.getClass().isPrimitive()) {
return new StringResult(value.toString());
} else {
return new JsonResult(value);
}
}