实际调用方法listOperations.leftPushAll(key, values);
按照预期,leftPushAll会调用listOperations的leftPushAll(K key, Collection<V> values)
方法,但是实际上调用的却是leftPushAll(K key, V... values)
,猜想大致是因为ListOperations<K, V>
//业务代码
@Resource(name = "redisTemplate")
private ListOperations<String, Object> listOperations;
//调用此方法
public <T> Long lPutAll(String key, Collection<T> values) {
final Long index = listOperations.leftPushAll(key, values);
return index;
}
//spring-redis
**ListOperations<K, V>**
@Nullable
Long leftPushAll(K key, V... values);
@Nullable
Long leftPushAll(K key, Collection<V> values);