All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redis.spring.batch.writer.Hset Maven / Gradle / Ivy

package com.redis.spring.batch.writer;

import java.util.Map;
import java.util.function.Function;

import org.springframework.util.CollectionUtils;

import io.lettuce.core.RedisFuture;
import io.lettuce.core.api.async.BaseRedisAsyncCommands;
import io.lettuce.core.api.async.RedisHashAsyncCommands;

public class Hset extends AbstractKeyValueOperation, T> {

	public Hset(Function keyFunction, Function> mapFunction) {
		super(keyFunction, mapFunction, CollectionUtils::isEmpty);
	}

	@SuppressWarnings({ "rawtypes", "unchecked" })
	@Override
	protected RedisFuture execute(BaseRedisAsyncCommands commands, T item, K key, Map value) {
		return ((RedisHashAsyncCommands) commands).hset(key, value);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy