List of usage examples for org.springframework.cache.support SimpleValueWrapper SimpleValueWrapper
public SimpleValueWrapper(@Nullable Object value)
From source file:org.springframework.data.redis.cache.RedisCache.java
public ValueWrapper get(final Object key) { return (ValueWrapper) template.execute(new RedisCallback<ValueWrapper>() { public ValueWrapper doInRedis(RedisConnection connection) throws DataAccessException { waitForLock(connection);//from w ww. j a v a2 s .c o m byte[] bs = connection.get(computeKey(key)); Object value = template.getValueSerializer() != null ? template.getValueSerializer().deserialize(bs) : bs; return (bs == null ? null : new SimpleValueWrapper(value)); } }, true); }
From source file:org.springframework.data.redis.cache.RedisCache.java
private ValueWrapper toWrapper(Object value) { return (value != null ? new SimpleValueWrapper(value) : null); }