org.springframework.data.redis.serializer.GenericToStringSerializer Java Examples

The following examples show how to use org.springframework.data.redis.serializer.GenericToStringSerializer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BootmonServerRedisConfig.java    From boot-mon with Apache License 2.0 5 votes vote down vote up
@Bean
public RedisTemplate<String, Object> redisTemplate() {
    final RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
    template.setConnectionFactory(jedisConnectionFactory());
    template.setValueSerializer(new GenericToStringSerializer<Object>(Object.class));
    return template;
}
 
Example #2
Source File: RedisConfiguration.java    From expper with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "redisListTemplate")
RedisTemplate<String, Long> redisListTemplate() {
    RedisTemplate<String, Long> redisTemplate = new RedisTemplate<>();
    redisTemplate.setConnectionFactory(jedisConnectionFactory());
    redisTemplate.setKeySerializer(new StringRedisSerializer());
    redisTemplate.setValueSerializer(new GenericToStringSerializer<>(Long.class));
    return redisTemplate;
}
 
Example #3
Source File: RedisConfiguration.java    From expper with GNU General Public License v3.0 5 votes vote down vote up
@Bean(name = "redisCountingTemplate")
RedisTemplate<String, Integer> redisCountingTemplate() {
    RedisTemplate<String, Integer> redisTemplate = new RedisTemplate<>();
    redisTemplate.setConnectionFactory(jedisConnectionFactory());
    redisTemplate.setKeySerializer(new StringRedisSerializer());
    redisTemplate.setHashKeySerializer(new StringRedisSerializer());
    redisTemplate.setHashValueSerializer(new GenericToStringSerializer<>(Integer.class));
    return redisTemplate;
}
 
Example #4
Source File: RedisConfig.java    From tutorials with MIT License 5 votes vote down vote up
@Bean
public RedisTemplate<String, Object> redisTemplate() {
    final RedisTemplate<String, Object> template = new RedisTemplate<String, Object>();
    template.setConnectionFactory(jedisConnectionFactory());
    template.setValueSerializer(new GenericToStringSerializer<Object>(Object.class));
    return template;
}