This commit is contained in:
梁显优 2023-05-09 10:47:56 +08:00
parent 54369c08dc
commit d40d4e6e5d
2 changed files with 4 additions and 4 deletions

View File

@ -71,9 +71,9 @@ public class MyRedisCacheSource extends RedisCacheSource {
} }
//--------------------- set ------------------------------ //--------------------- set ------------------------------
/*public <T> void sadd(String key, Collection<T> args) { public <T> void sadd(String key, Collection<T> args) {
saddAsync(key, args.toArray(Serializable[]::new)).join(); saddAsync(key, args.toArray(Serializable[]::new)).join();
}*/ }
public void sadd(String key, Serializable... args) { public void sadd(String key, Serializable... args) {
saddAsync(key, Arrays.stream(args).toArray(Serializable[]::new)).join(); saddAsync(key, Arrays.stream(args).toArray(Serializable[]::new)).join();

View File

@ -5,7 +5,6 @@ import org.redkale.util.AnyValue;
import org.redkale.util.ResourceFactory; import org.redkale.util.ResourceFactory;
import org.redkalex.cache.redis.MyRedisCacheSource; import org.redkalex.cache.redis.MyRedisCacheSource;
import java.awt.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -60,6 +59,7 @@ public class RedisTest {
// source.sadd("setx", list.toArray(Integer[]::new)); // source.sadd("setx", list.toArray(Integer[]::new));
source.sadd("setx", list.toArray(Integer[]::new)); source.sadd("setx", list.toArray(Integer[]::new));
source.sadd("setx", 12, 2312, 213); source.sadd("setx", 12, 2312, 213);
source.sadd("setx", List.of(1011, 10222));
source.keys("setx*").forEach(x -> { source.keys("setx*").forEach(x -> {
System.out.println(x); System.out.println(x);