code: public static <K, V> RedisTemplate<K, V> newRedisTemplate(final RedisConnectionFactory connectionFactory) {
          val template = new RedisTemplate<K, V>();
          val string = new StringRedisSerializer();
          val jdk = new JdkSerializationRedisSerializer();
          template.setKeySerializer(string);
          template.setValueSerializer(jdk);
          template.setHashValueSerializer(jdk);
          template.setHashKeySerializer(string);
          template.setConnectionFactory(connectionFactory);
          return template;
      }
docs: New redis template.
  
  @param <K>               the type parameter
  @param <V>               the type parameter
  @param connectionFactory the connection factory
  @return the redis template