Example usage for org.springframework.data.redis.core ListOperations leftPushAll

List of usage examples for org.springframework.data.redis.core ListOperations leftPushAll

Introduction

In this page you can find the example usage for org.springframework.data.redis.core ListOperations leftPushAll.

Prototype

@Nullable
Long leftPushAll(K key, Collection<V> values);

Source Link

Document

Prepend values to key .

Usage

From source file:com.company.project.service.dao.RedisDao.java

/**
 * Push a list to the left of list//  w  w w  .j  a  va  2  s  .c o m
 * - TODO unable to use "opsForList.trim(key, start, end)".
 * - use opsForList.leftPop(key) or opsForList.rightPop(key)
 * @param key
 * @param listValues 
 */
public long leftPushAllList(String key, Object... listValues) {
    ListOperations opsForList = redisTemplate.opsForList();
    return opsForList.leftPushAll(key, listValues);
}