com.redis.spring.batch.writer.operation.Sadd Maven / Gradle / Ivy
package com.redis.spring.batch.writer.operation;
import java.util.List;
import java.util.function.Function;
import io.lettuce.core.RedisFuture;
import io.lettuce.core.api.async.BaseRedisAsyncCommands;
import io.lettuce.core.api.async.RedisSetAsyncCommands;
public class Sadd extends AbstractOperation {
private Function value;
public void setValue(Function value) {
this.value = value;
}
@SuppressWarnings("unchecked")
@Override
public void execute(BaseRedisAsyncCommands commands, T item, List> futures) {
futures.add(((RedisSetAsyncCommands) commands).sadd(key(item), value.apply(item)));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy