diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSet.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSet.java index 54a31ce73..cb5c9a75a 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSet.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/DefaultRedisSet.java @@ -53,6 +53,11 @@ public class DefaultRedisSet extends AbstractRedisCollection implements Re boundSetOps = operations.forSet(key); } + /** + * Constructs a new DefaultRedisSet instance. + * + * @param boundOps + */ public DefaultRedisSet(BoundSetOperations boundOps) { super(boundOps.getKey(), boundOps.getOperations()); this.boundSetOps = boundOps; @@ -66,7 +71,7 @@ public class DefaultRedisSet extends AbstractRedisCollection implements Re @Override public RedisSet diffAndStore(String destKey, RedisSet... sets) { boundSetOps.diffAndStore(destKey, extractKeys(sets)); - return new DefaultRedisSet(boundSetOps); + return new DefaultRedisSet(boundSetOps.getOperations().forSet(destKey)); } @Override @@ -77,7 +82,7 @@ public class DefaultRedisSet extends AbstractRedisCollection implements Re @Override public RedisSet intersectAndStore(String destKey, RedisSet... sets) { boundSetOps.intersectAndStore(destKey, extractKeys(sets)); - return new DefaultRedisSet(boundSetOps); + return new DefaultRedisSet(boundSetOps.getOperations().forSet(destKey)); } @Override @@ -88,7 +93,7 @@ public class DefaultRedisSet extends AbstractRedisCollection implements Re @Override public RedisSet unionAndStore(String destKey, RedisSet... sets) { boundSetOps.unionAndStore(destKey, extractKeys(sets)); - return new DefaultRedisSet(boundSetOps); + return new DefaultRedisSet(boundSetOps.getOperations().forSet(destKey)); } @Override diff --git a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSet.java b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSet.java index a3e32202d..76ecf3fa4 100644 --- a/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSet.java +++ b/spring-datastore-redis/src/main/java/org/springframework/datastore/redis/util/RedisSet.java @@ -1,39 +1,39 @@ -/* - * Copyright 2010 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.springframework.datastore.redis.util; - -import java.util.Set; - -/** - * Redis extension for the {@link Set} contract. Supports {@link Set} specific - * operations backed by Redis commands. - * - * @author Costin Leau - */ -public interface RedisSet extends RedisStore, Set { - - Set intersect(RedisSet... sets); - - Set union(RedisSet... sets); - - Set diff(RedisSet... sets); - - RedisSet intersectAndStore(String destKey, RedisSet... sets); - - RedisSet unionAndStore(String destKey, RedisSet... sets); - - RedisSet diffAndStore(String destKey, RedisSet... sets); -} +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.springframework.datastore.redis.util; + +import java.util.Set; + +/** + * Redis extension for the {@link Set} contract. Supports {@link Set} specific + * operations backed by Redis operations. + * + * @author Costin Leau + */ +public interface RedisSet extends RedisStore, Set { + + Set intersect(RedisSet... sets); + + Set union(RedisSet... sets); + + Set diff(RedisSet... sets); + + RedisSet intersectAndStore(String destKey, RedisSet... sets); + + RedisSet unionAndStore(String destKey, RedisSet... sets); + + RedisSet diffAndStore(String destKey, RedisSet... sets); +}