Example usage for org.springframework.data.redis.core BoundHashOperations putIfAbsent

List of usage examples for org.springframework.data.redis.core BoundHashOperations putIfAbsent

Introduction

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

Prototype

@Nullable
Boolean putIfAbsent(HK key, HV value);

Source Link

Document

Set the value of a hash key only if key does not exist.

Usage

From source file:com.chessix.vas.service.RedisStorage.java

@Override
public boolean create(final String clasId, final String accountId) {
    final BoundHashOperations<String, Object, Object> ops = redisTemplate.boundHashOps(clasId);
    return ops.putIfAbsent(accountId, "0");
}