Deprecated methods removed

pull/578/head^2
Nikita 9 years ago
parent e4d2a06240
commit e258d82796

@ -33,52 +33,27 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return removeRangeByLex(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public int removeRangeByLex(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return get(removeRangeAsync(fromElement, fromInclusive, toElement, toInclusive));
}
@Override
public int removeRangeHead(String toElement, boolean toInclusive) {
return removeRangeHeadByLex(toElement, toInclusive);
}
@Override
public int removeRangeHeadByLex(String toElement, boolean toInclusive) {
return get(removeRangeHeadAsync(toElement, toInclusive));
}
@Override
public RFuture<Integer> removeRangeHeadAsync(String toElement, boolean toInclusive) {
return removeRangeHeadByLexAsync(toElement, toInclusive);
}
@Override
public RFuture<Integer> removeRangeHeadByLexAsync(String toElement, boolean toInclusive) {
String toValue = value(toElement, toInclusive);
return commandExecutor.writeAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZREMRANGEBYLEX, getName(), "-", toValue);
}
@Override
public int removeRangeTail(String fromElement, boolean fromInclusive) {
return removeRangeTailByLex(fromElement, fromInclusive);
}
@Override
public int removeRangeTailByLex(String fromElement, boolean fromInclusive) {
return get(removeRangeTailAsync(fromElement, fromInclusive));
}
@Override
public RFuture<Integer> removeRangeTailAsync(String fromElement, boolean fromInclusive) {
return removeRangeTailByLexAsync(fromElement, fromInclusive);
}
@Override
public RFuture<Integer> removeRangeTailByLexAsync(String fromElement, boolean fromInclusive) {
String fromValue = value(fromElement, fromInclusive);
return commandExecutor.writeAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZREMRANGEBYLEX, getName(), fromValue, "+");
}
@ -86,11 +61,6 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement,
boolean toInclusive) {
return removeRangeByLexAsync(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public RFuture<Integer> removeRangeByLexAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
String fromValue = value(fromElement, fromInclusive);
String toValue = value(toElement, toInclusive);
@ -99,52 +69,27 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return lexRange(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public Collection<String> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return get(rangeAsync(fromElement, fromInclusive, toElement, toInclusive));
}
@Override
public Collection<String> rangeHead(String toElement, boolean toInclusive) {
return lexRangeHead(toElement, toInclusive);
}
@Override
public Collection<String> lexRangeHead(String toElement, boolean toInclusive) {
return get(rangeHeadAsync(toElement, toInclusive));
}
@Override
public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive) {
return lexRangeHeadAsync(toElement, toInclusive);
}
@Override
public RFuture<Collection<String>> lexRangeHeadAsync(String toElement, boolean toInclusive) {
String toValue = value(toElement, toInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), "-", toValue);
}
@Override
public Collection<String> rangeTail(String fromElement, boolean fromInclusive) {
return lexRangeTail(fromElement, fromInclusive);
}
@Override
public Collection<String> lexRangeTail(String fromElement, boolean fromInclusive) {
return get(rangeTailAsync(fromElement, fromInclusive));
}
@Override
public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive) {
return lexRangeTailAsync(fromElement, fromInclusive);
}
@Override
public RFuture<Collection<String>> lexRangeTailAsync(String fromElement, boolean fromInclusive) {
String fromValue = value(fromElement, fromInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, "+");
}
@ -152,11 +97,6 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement,
boolean toInclusive) {
return lexRangeAsync(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public RFuture<Collection<String>> lexRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
String fromValue = value(fromElement, fromInclusive);
String toValue = value(toElement, toInclusive);
@ -166,52 +106,27 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive,
int offset, int count) {
return lexRange(fromElement, fromInclusive, toElement, toInclusive, offset, count);
}
@Override
public Collection<String> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) {
return get(rangeAsync(fromElement, fromInclusive, toElement, toInclusive, offset, count));
}
@Override
public Collection<String> rangeHead(String toElement, boolean toInclusive, int offset, int count) {
return lexRangeHead(toElement, toInclusive, offset, count);
}
@Override
public Collection<String> lexRangeHead(String toElement, boolean toInclusive, int offset, int count) {
return get(rangeHeadAsync(toElement, toInclusive, offset, count));
}
@Override
public RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) {
return lexRangeHeadAsync(toElement, toInclusive, offset, count);
}
@Override
public RFuture<Collection<String>> lexRangeHeadAsync(String toElement, boolean toInclusive, int offset, int count) {
String toValue = value(toElement, toInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), "-", toValue, "LIMIT", offset, count);
}
@Override
public Collection<String> rangeTail(String fromElement, boolean fromInclusive, int offset, int count) {
return lexRangeTail(fromElement, fromInclusive, offset, count);
}
@Override
public Collection<String> lexRangeTail(String fromElement, boolean fromInclusive, int offset, int count) {
return get(rangeTailAsync(fromElement, fromInclusive, offset, count));
}
@Override
public RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) {
return lexRangeTailAsync(fromElement, fromInclusive, offset, count);
}
@Override
public RFuture<Collection<String>> lexRangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count) {
String fromValue = value(fromElement, fromInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZRANGEBYLEX, getName(), fromValue, "+", "LIMIT", offset, count);
}
@ -219,11 +134,6 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement,
boolean toInclusive, int offset, int count) {
return lexRangeAsync(fromElement, fromInclusive, toElement, toInclusive, offset, count);
}
@Override
public RFuture<Collection<String>> lexRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count) {
String fromValue = value(fromElement, fromInclusive);
String toValue = value(toElement, toInclusive);
@ -232,21 +142,11 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public int countTail(String fromElement, boolean fromInclusive) {
return lexCountTail(fromElement, fromInclusive);
}
@Override
public int lexCountTail(String fromElement, boolean fromInclusive) {
return get(countTailAsync(fromElement, fromInclusive));
}
@Override
public RFuture<Integer> countTailAsync(String fromElement, boolean fromInclusive) {
return lexCountTailAsync(fromElement, fromInclusive);
}
@Override
public RFuture<Integer> lexCountTailAsync(String fromElement, boolean fromInclusive) {
String fromValue = value(fromElement, fromInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZLEXCOUNT, getName(), fromValue, "+");
@ -254,21 +154,11 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public int countHead(String toElement, boolean toInclusive) {
return lexCountHead(toElement, toInclusive);
}
@Override
public int lexCountHead(String toElement, boolean toInclusive) {
return get(countHeadAsync(toElement, toInclusive));
}
@Override
public RFuture<Integer> countHeadAsync(String toElement, boolean toInclusive) {
return lexCountHeadAsync(toElement, toInclusive);
}
@Override
public RFuture<Integer> lexCountHeadAsync(String toElement, boolean toInclusive) {
String toValue = value(toElement, toInclusive);
return commandExecutor.readAsync(getName(), StringCodec.INSTANCE, RedisCommands.ZLEXCOUNT, getName(), "-", toValue);
@ -276,22 +166,12 @@ public class RedissonLexSortedSet extends RedissonScoredSortedSet<String> implem
@Override
public int count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return lexCount(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public int lexCount(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
return get(countAsync(fromElement, fromInclusive, toElement, toInclusive));
}
@Override
public RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement,
boolean toInclusive) {
return lexCountAsync(fromElement, fromInclusive, toElement, toInclusive);
}
@Override
public RFuture<Integer> lexCountAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive) {
String fromValue = value(fromElement, fromInclusive);
String toValue = value(toElement, toInclusive);

@ -24,13 +24,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.redisson.api.Predicate;
import org.redisson.api.RFuture;
import org.redisson.api.RMap;
import org.redisson.client.codec.Codec;
@ -356,68 +354,6 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
return get(f);
}
@Override
public Iterator<Map.Entry<K, V>> entryIterator() {
return new RedissonMapIterator<K, V, Map.Entry<K, V>>(this);
}
@Override
public Iterator<V> valueIterator() {
return new RedissonMapIterator<K, V, V>(this) {
@Override
V getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {
return (V) entry.getValue().getObj();
}
};
}
@Override
public Iterator<K> keyIterator() {
return new RedissonMapIterator<K, V, K>(this) {
@Override
K getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {
return (K) entry.getKey().getObj();
}
};
}
@Override
public Map<K, V> filterKeys(Predicate<K> predicate) {
Map<K, V> result = new HashMap<K, V>();
for (Iterator<Map.Entry<K, V>> iterator = entryIterator(); iterator.hasNext();) {
Map.Entry<K, V> entry = iterator.next();
if (predicate.apply(entry.getKey())) {
result.put(entry.getKey(), entry.getValue());
}
}
return result;
}
@Override
public Map<K, V> filterValues(Predicate<V> predicate) {
Map<K, V> result = new HashMap<K, V>();
for (Iterator<Map.Entry<K, V>> iterator = entryIterator(); iterator.hasNext();) {
Map.Entry<K, V> entry = iterator.next();
if (predicate.apply(entry.getValue())) {
result.put(entry.getKey(), entry.getValue());
}
}
return result;
}
@Override
public Map<K, V> filterEntries(Predicate<Map.Entry<K, V>> predicate) {
Map<K, V> result = new HashMap<K, V>();
for (Iterator<Map.Entry<K, V>> iterator = entryIterator(); iterator.hasNext();) {
Map.Entry<K, V> entry = iterator.next();
if (predicate.apply(entry)) {
result.put(entry.getKey(), entry.getValue());
}
}
return result;
}
@Override
public V addAndGet(K key, Number value) {
return get(addAndGetAsync(key, value));
@ -482,7 +418,12 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
@Override
public Iterator<K> iterator() {
return RedissonMap.this.keyIterator();
return new RedissonMapIterator<K, V, K>(RedissonMap.this) {
@Override
K getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {
return (K) entry.getKey().getObj();
}
};
}
@Override
@ -511,7 +452,12 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
@Override
public Iterator<V> iterator() {
return valueIterator();
return new RedissonMapIterator<K, V, V>(RedissonMap.this) {
@Override
V getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {
return (V) entry.getValue().getObj();
}
};
}
@Override
@ -534,7 +480,7 @@ public class RedissonMap<K, V> extends RedissonExpirable implements RMap<K, V> {
final class EntrySet extends AbstractSet<Map.Entry<K,V>> {
public final Iterator<Map.Entry<K,V>> iterator() {
return entryIterator();
return new RedissonMapIterator<K, V, Map.Entry<K, V>>(RedissonMap.this);
}
public final boolean contains(Object o) {

@ -1,22 +0,0 @@
/**
* Copyright 2016 Nikita Koksharov
*
* 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.redisson.api;
public interface Predicate<T> {
boolean apply(T input);
}

@ -45,108 +45,30 @@ public interface RLexSortedSet extends RLexSortedSetAsync, Set<String>, RExpirab
int removeRangeTail(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSet#removeRangeTail(String, boolean)}
*/
@Deprecated
int removeRangeTailByLex(String fromElement, boolean fromInclusive);
int removeRangeHead(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#removeRangeHead(String, boolean)}
*/
@Deprecated
int removeRangeHeadByLex(String toElement, boolean toInclusive);
int removeRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#removeRange(String, boolean)}
*/
@Deprecated
int removeRangeByLex(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
int countTail(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSet#countTail(String, boolean)}
*/
@Deprecated
int lexCountTail(String fromElement, boolean fromInclusive);
int countHead(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#countHead(String, boolean)}
*/
@Deprecated
int lexCountHead(String toElement, boolean toInclusive);
Collection<String> rangeTail(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSet#rangeTail(String, boolean)}
*/
@Deprecated
Collection<String> lexRangeTail(String fromElement, boolean fromInclusive);
Collection<String> rangeHead(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#rangeHead(String, boolean)}
*/
@Deprecated
Collection<String> lexRangeHead(String toElement, boolean toInclusive);
Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#range(String, boolean, String, boolean)}
*/
@Deprecated
Collection<String> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
Collection<String> rangeTail(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Use {@link RLexSortedSet#rangeTail(String, boolean, int, int)}
*/
@Deprecated
Collection<String> lexRangeTail(String fromElement, boolean fromInclusive, int offset, int count);
Collection<String> rangeHead(String toElement, boolean toInclusive, int offset, int count);
/**
* Use {@link RLexSortedSet#rangeHead(String, boolean, int, int)}
*/
@Deprecated
Collection<String> lexRangeHead(String toElement, boolean toInclusive, int offset, int count);
Collection<String> range(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Use {@link RLexSortedSet#range(String, boolean, String, boolean, int, int)}
*/
@Deprecated
Collection<String> lexRange(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
int count(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSet#count(String, boolean, String, boolean)}
*/
@Deprecated
int lexCount(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
Integer rank(String o);
Collection<String> range(int startIndex, int endIndex);
/**
* Use {@link RLexSortedSet#range(int, int)}
*/
@Deprecated
Collection<String> valueRange(int startIndex, int endIndex);
}

@ -36,110 +36,32 @@ public interface RLexSortedSetAsync extends RCollectionAsync<String> {
RFuture<Integer> removeRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#removeRangeAsync(String, boolean, String, boolean)}
*/
@Deprecated
RFuture<Integer> removeRangeByLexAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
RFuture<Integer> removeRangeTailAsync(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSetAsync#removeRangeTailAsync(String, boolean, String, boolean)}
*/
@Deprecated
RFuture<Integer> removeRangeTailByLexAsync(String fromElement, boolean fromInclusive);
RFuture<Integer> removeRangeHeadAsync(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#removeRangeHeadAsync(String, boolean)}
*/
@Deprecated
RFuture<Integer> removeRangeHeadByLexAsync(String toElement, boolean toInclusive);
RFuture<Integer> countTailAsync(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSetAsync#countTailAsync(String, boolean)}
*/
@Deprecated
RFuture<Integer> lexCountTailAsync(String fromElement, boolean fromInclusive);
RFuture<Integer> countHeadAsync(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#countHeadAsync(String, boolean)}
*/
@Deprecated
RFuture<Integer> lexCountHeadAsync(String toElement, boolean toInclusive);
RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive);
/**
* Use {@link RLexSortedSetAsync#rangeTailAsync(String, boolean)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeTailAsync(String fromElement, boolean fromInclusive);
RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#rangeHeadAsync(String, boolean)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeHeadAsync(String toElement, boolean toInclusive);
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#rangeAsync(String, boolean, String, boolean)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
RFuture<Collection<String>> rangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count);
/**
* Use {@link RLexSortedSetAsync#rangeTailAsync(String, boolean, int, int)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeTailAsync(String fromElement, boolean fromInclusive, int offset, int count);
RFuture<Collection<String>> rangeHeadAsync(String toElement, boolean toInclusive, int offset, int count);
/**
* Use {@link RLexSortedSetAsync#rangeHeadAsync(String, boolean, int, int)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeHeadAsync(String toElement, boolean toInclusive, int offset, int count);
RFuture<Collection<String>> rangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
/**
* Use {@link RLexSortedSetAsync#rangeAsync(String, boolean, String, boolean, int, int)}
*/
@Deprecated
RFuture<Collection<String>> lexRangeAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive, int offset, int count);
RFuture<Integer> countAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
/**
* Use {@link RLexSortedSetAsync#countAsync(String, boolean, String, boolean)}
*/
@Deprecated
RFuture<Integer> lexCountAsync(String fromElement, boolean fromInclusive, String toElement, boolean toInclusive);
RFuture<Integer> rankAsync(String o);
RFuture<Collection<String>> rangeAsync(int startIndex, int endIndex);
/**
* Use {@link RLexSortedSetAsync#rangeAsync(int, int)}
*/
@Deprecated
RFuture<Collection<String>> valueRangeAsync(int startIndex, int endIndex);
/**
* Returns rank of value, with the scores ordered from high to low.
*

@ -16,7 +16,6 @@
package org.redisson.api;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
@ -58,42 +57,6 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K
*/
Map<K, V> getAll(Set<K> keys);
/**
* Returns a map slice containing the mappings in whose <code>Map.Entry&lt;K, V&gt; entries</code>
* satisfy a predicate. This operation traverses all map entries with small memory footprint.
*
* The returned map is <b>NOT</b> backed by the original map.
*
* @param predicate
* @return
*/
@Deprecated
Map<K, V> filterEntries(Predicate<Map.Entry<K, V>> predicate);
/**
* Returns a map slice containing the mappings in whose <code>values</code>
* satisfy a predicate. Traverses all map entries with small memory footprint.
*
* The returned map is <b>NOT</b> backed by the original map.
*
* @param predicate
* @return
*/
@Deprecated
Map<K, V> filterValues(Predicate<V> predicate);
/**
* Returns a map slice containing the mappings in whose <code>keys</code>
* satisfy a predicate. Traverses all map entries with small memory footprint.
*
* The returned map is <b>NOT</b> backed by the original map.
*
* @param predicate
* @return
*/
@Deprecated
Map<K, V> filterKeys(Predicate<K> predicate);
/**
* Removes <code>keys</code> from map by one operation
*
@ -142,24 +105,24 @@ public interface RMap<K, V> extends ConcurrentMap<K, V>, RExpirable, RMapAsync<K
Set<Entry<K, V>> readAllEntrySet();
/**
* Use {@link #entrySet().iterator()}
*
* Returns key set.
* This method <b>DOESN'T</b> fetch all of them as {@link #readAllKeySet()} does.
*/
@Deprecated
Iterator<Map.Entry<K, V>> entryIterator();
@Override
Set<K> keySet();
/**
* Use {@link #keySet().iterator()}
*
* Returns values collections.
* This method <b>DOESN'T</b> fetch all of them as {@link #readAllValues()} does.
*/
@Deprecated
Iterator<K> keyIterator();
@Override
Collection<V> values();
/**
* Use {@link #values().iterator()}
*
* Returns values collections.
* This method <b>DOESN'T</b> fetch all of them as {@link #readAllEntrySet()} does.
*/
@Deprecated
Iterator<V> valueIterator();
@Override
Set<java.util.Map.Entry<K, V>> entrySet();
}

@ -75,20 +75,4 @@ public class ClusterServersConfig extends BaseMasterSlaveServersConfig<ClusterSe
return this;
}
/**
* Use {@link #setReadMode(org.redisson.config.BaseMasterSlaveServersConfig.ReadMode)}
*
* @param readFromSlaves
* @return
*/
@Deprecated
public ClusterServersConfig setReadFromSlaves(boolean readFromSlaves) {
ReadMode readMode = ReadMode.MASTER;
if (readFromSlaves) {
readMode = ReadMode.SLAVE;
}
setReadMode(readMode);
return this;
}
}

@ -114,13 +114,7 @@ public class Config {
return useClusterServers(new ClusterServersConfig());
}
/**
* Init cluster servers configuration by config object.
*
* @return
*/
@Deprecated
public ClusterServersConfig useClusterServers(ClusterServersConfig config) {
ClusterServersConfig useClusterServers(ClusterServersConfig config) {
checkMasterSlaveServersConfig();
checkSentinelServersConfig();
checkSingleServerConfig();
@ -149,13 +143,7 @@ public class Config {
return useElasticacheServers(new ElasticacheServersConfig());
}
/**
* Init AWS Elasticache servers configuration by config object.
*
* @return
*/
@Deprecated
public ElasticacheServersConfig useElasticacheServers(ElasticacheServersConfig config) {
ElasticacheServersConfig useElasticacheServers(ElasticacheServersConfig config) {
checkClusterServersConfig();
checkMasterSlaveServersConfig();
checkSentinelServersConfig();
@ -184,13 +172,7 @@ public class Config {
return useSingleServer(new SingleServerConfig());
}
/**
* Init single server configuration by config object.
*
* @return
*/
@Deprecated
public SingleServerConfig useSingleServer(SingleServerConfig config) {
SingleServerConfig useSingleServer(SingleServerConfig config) {
checkClusterServersConfig();
checkMasterSlaveServersConfig();
checkSentinelServersConfig();

@ -14,11 +14,8 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.Test;
import org.redisson.api.Predicate;
import org.redisson.api.RMap;
import org.redisson.client.codec.StringCodec;
import org.redisson.codec.JsonJacksonCodec;
@ -187,22 +184,6 @@ public class RedissonMapTest extends BaseTest {
assertThat(filtered).isEqualTo(expectedMap);
}
@Test
public void testFilterKeys() {
RMap<Integer, Integer> map = redisson.getMap("filterKeys");
map.put(1, 100);
map.put(2, 200);
map.put(3, 300);
map.put(4, 400);
Map<Integer, Integer> filtered = map.filterKeys(input -> input >= 2 && input <= 3);
Map<Integer, Integer> expectedMap = new HashMap<Integer, Integer>();
expectedMap.put(2, 200);
expectedMap.put(3, 300);
assertThat(filtered).isEqualTo(expectedMap);
}
@Test
public void testStringCodec() {
Config config = createConfig();
@ -661,7 +642,7 @@ public class RedissonMapTest extends BaseTest {
Collection<Integer> keys = map.keySet();
assertThat(keys).containsOnly(1, 3, 4, 7);
for (Iterator<Integer> iterator = map.keyIterator(); iterator.hasNext();) {
for (Iterator<Integer> iterator = map.keySet().iterator(); iterator.hasNext();) {
Integer value = iterator.next();
if (!keys.remove(value)) {
Assert.fail();
@ -681,7 +662,7 @@ public class RedissonMapTest extends BaseTest {
Collection<Integer> values = map.values();
assertThat(values).containsOnly(0, 5, 6, 8);
for (Iterator<Integer> iterator = map.valueIterator(); iterator.hasNext();) {
for (Iterator<Integer> iterator = map.values().iterator(); iterator.hasNext();) {
Integer value = iterator.next();
if (!values.remove(value)) {
Assert.fail();

@ -14,6 +14,7 @@ import java.util.TreeSet;
import java.util.concurrent.ExecutionException;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
import org.redisson.api.RLexSortedSet;
import org.redisson.api.RScoredSortedSet;
@ -22,7 +23,6 @@ import org.redisson.client.codec.StringCodec;
import org.redisson.client.protocol.ScoredEntry;
import io.netty.util.concurrent.Future;
import org.junit.Assume;
public class RedissonScoredSortedSetTest extends BaseTest {
@ -572,7 +572,7 @@ public class RedissonScoredSortedSetTest extends BaseTest {
set.add("d");
set.add("e");
Collection<String> r = set.lexRange("b", true, "e", false, 1, 2);
Collection<String> r = set.range("b", true, "e", false, 1, 2);
String[] a = r.toArray(new String[0]);
Assert.assertArrayEquals(new String[]{"c", "d"}, a);
}

Loading…
Cancel
Save