@Test public void getObject() { User user = (User)jedisJsonCacheService.getObject("user02",User.class); logger.info("User name={},age={}",user.getName(),user.getAge()); }
public Object getObject(String key,Class clazz) { Jedis jedis = null; Object object = null; try { jedis = jedisPool.getResource(); String objectJson = jedis.get(key); object = toObjce(objectJson,clazz); }catch (Exception e){ e.printStackTrace(); }finally { close(jedis); } return object; }
JedisJsonCacheService extends JedisCacheServiceSupport { public Object getObject(String key,Class clazz) { Jedis jedis = null; Object object = null; try { jedis = jedisPool.getResource(); String objectJson = jedis.get(key); object = toObjce(objectJson,clazz); }catch (Exception e){ e.printStackTrace(); }finally { close(jedis); } return object; } }
JedisJsonCacheService extends JedisCacheServiceSupport { public Object getObject(String key,Class clazz) { Jedis jedis = null; Object object = null; try { jedis = jedisPool.getResource(); String objectJson = jedis.get(key); object = toObjce(objectJson,clazz); }catch (Exception e){ e.printStackTrace(); }finally { close(jedis); } return object; }  }
JedisJsonCacheService extends JedisCacheServiceSupport { public Object getObject(String key,Class clazz) { Jedis jedis = null; Object object = null; try { jedis = jedisPool.getResource(); String objectJson = jedis.get(key); object = toObjce(objectJson,clazz); }catch (Exception e){ e.printStackTrace(); }finally { close(jedis); } return object; }  Object getObject(String key,Class clazz); void putObject(String key, Object value); void putObject(String key, Object value, Long expireTime); }
JedisJsonCacheService extends JedisCacheServiceSupport { public Object getObject(String key,Class clazz) { Jedis jedis = null; Object object = null; try { jedis = jedisPool.getResource(); String objectJson = jedis.get(key); object = toObjce(objectJson,clazz); }catch (Exception e){ e.printStackTrace(); }finally { close(jedis); } return object; }  Object getObject(String key,Class clazz); void putObject(String key, Object value); void putObject(String key, Object value, Long expireTime);  }