Skip to content

Commit

Permalink
MultiMap renamed to Multimap. #404
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita committed Mar 2, 2016
1 parent ca0e53b commit 9c67999
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 53 deletions.
10 changes: 5 additions & 5 deletions src/main/java/org/redisson/Redisson.java
Expand Up @@ -64,7 +64,7 @@
import org.redisson.core.RSemaphore;
import org.redisson.core.RSet;
import org.redisson.core.RSetCache;
import org.redisson.core.RSetMultiMap;
import org.redisson.core.RSetMultimap;
import org.redisson.core.RSortedSet;
import org.redisson.core.RTopic;

Expand Down Expand Up @@ -251,13 +251,13 @@ public <K, V> RMap<K, V> getMap(String name) {
}

@Override
public <K, V> RSetMultiMap<K, V> getSetMultiMap(String name) {
return new RedissonSetMultiMap<K, V>(commandExecutor, name);
public <K, V> RSetMultimap<K, V> getSetMultimap(String name) {
return new RedissonSetMultimap<K, V>(commandExecutor, name);
}

@Override
public <K, V> RSetMultiMap<K, V> getSetMultiMap(String name, Codec codec) {
return new RedissonSetMultiMap<K, V>(codec, commandExecutor, name);
public <K, V> RSetMultimap<K, V> getSetMultimap(String name, Codec codec) {
return new RedissonSetMultimap<K, V>(codec, commandExecutor, name);
}

@Override
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/redisson/RedissonClient.java
Expand Up @@ -48,7 +48,7 @@
import org.redisson.core.RSemaphore;
import org.redisson.core.RSet;
import org.redisson.core.RSetCache;
import org.redisson.core.RSetMultiMap;
import org.redisson.core.RSetMultimap;
import org.redisson.core.RSortedSet;
import org.redisson.core.RTopic;

Expand Down Expand Up @@ -240,7 +240,7 @@ public interface RedissonClient {
* @param name
* @return
*/
<K, V> RSetMultiMap<K, V> getSetMultiMap(String name);
<K, V> RSetMultimap<K, V> getSetMultimap(String name);

/**
* Returns Set based MultiMap instance by name
Expand All @@ -250,7 +250,7 @@ public interface RedissonClient {
* @param codec
* @return
*/
<K, V> RSetMultiMap<K, V> getSetMultiMap(String name, Codec codec);
<K, V> RSetMultimap<K, V> getSetMultimap(String name, Codec codec);

/**
* Returns semaphore instance by name
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/redisson/RedissonMultiMapIterator.java
Expand Up @@ -27,7 +27,7 @@
import org.redisson.client.protocol.decoder.MapScanResult;
import org.redisson.client.protocol.decoder.ScanObjectEntry;
import org.redisson.command.CommandAsyncExecutor;
import org.redisson.RedissonSetMultiMap;
import org.redisson.RedissonSetMultimap;

import io.netty.buffer.ByteBuf;

Expand All @@ -47,13 +47,13 @@ public class RedissonMultiMapIterator<K, V, M> implements Iterator<M> {
private boolean removeExecuted;
protected V entry;

private final RedissonSetMultiMap<K, V> map;
private final RedissonSetMultimap<K, V> map;

final CommandAsyncExecutor commandExecutor;
final Codec codec;


public RedissonMultiMapIterator(RedissonSetMultiMap<K, V> map, CommandAsyncExecutor commandExecutor, Codec codec) {
public RedissonMultiMapIterator(RedissonSetMultimap<K, V> map, CommandAsyncExecutor commandExecutor, Codec codec) {
this.map = map;
this.commandExecutor = commandExecutor;
this.codec = codec;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/redisson/RedissonMultiMapKeysIterator.java
Expand Up @@ -22,9 +22,9 @@

public class RedissonMultiMapKeysIterator<K, V, M> extends RedissonBaseMapIterator<K, V, M> {

private final RedissonSetMultiMap<K, V> map;
private final RedissonSetMultimap<K, V> map;

public RedissonMultiMapKeysIterator(RedissonSetMultiMap<K, V> map) {
public RedissonMultiMapKeysIterator(RedissonSetMultimap<K, V> map) {
this.map = map;
}

Expand Down
Expand Up @@ -40,7 +40,7 @@
import org.redisson.client.protocol.decoder.MapScanResult;
import org.redisson.client.protocol.decoder.ScanObjectEntry;
import org.redisson.command.CommandAsyncExecutor;
import org.redisson.core.RSetMultiMap;
import org.redisson.core.RSetMultimap;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
Expand All @@ -55,16 +55,16 @@
* @param <K> key
* @param <V> value
*/
public class RedissonSetMultiMap<K, V> extends RedissonExpirable implements RSetMultiMap<K, V> {
public class RedissonSetMultimap<K, V> extends RedissonExpirable implements RSetMultimap<K, V> {

private static final RedisStrictCommand<Boolean> SCARD_VALUE = new RedisStrictCommand<Boolean>("SCARD", new BooleanAmountReplayConvertor());
private static final RedisCommand<Boolean> SISMEMBER_VALUE = new RedisCommand<Boolean>("SISMEMBER", new BooleanReplayConvertor());

RedissonSetMultiMap(CommandAsyncExecutor connectionManager, String name) {
RedissonSetMultimap(CommandAsyncExecutor connectionManager, String name) {
super(connectionManager, name);
}

RedissonSetMultiMap(Codec codec, CommandAsyncExecutor connectionManager, String name) {
RedissonSetMultimap(Codec codec, CommandAsyncExecutor connectionManager, String name) {
super(codec, connectionManager, name);
}

Expand Down Expand Up @@ -388,7 +388,7 @@ final class KeySet extends AbstractSet<K> {

@Override
public Iterator<K> iterator() {
return new RedissonMultiMapKeysIterator<K, V, K>(RedissonSetMultiMap.this) {
return new RedissonMultiMapKeysIterator<K, V, K>(RedissonSetMultimap.this) {
@Override
K getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {
return (K) entry.getKey().getObj();
Expand All @@ -398,22 +398,22 @@ K getValue(java.util.Map.Entry<ScanObjectEntry, ScanObjectEntry> entry) {

@Override
public boolean contains(Object o) {
return RedissonSetMultiMap.this.containsKey(o);
return RedissonSetMultimap.this.containsKey(o);
}

@Override
public boolean remove(Object o) {
return RedissonSetMultiMap.this.fastRemove((K)o) == 1;
return RedissonSetMultimap.this.fastRemove((K)o) == 1;
}

@Override
public int size() {
return RedissonSetMultiMap.this.size();
return RedissonSetMultimap.this.size();
}

@Override
public void clear() {
RedissonSetMultiMap.this.clear();
RedissonSetMultimap.this.clear();
}

}
Expand All @@ -422,7 +422,7 @@ final class Values extends AbstractCollection<V> {

@Override
public Iterator<V> iterator() {
return new RedissonMultiMapIterator<K, V, V>(RedissonSetMultiMap.this, commandExecutor, codec) {
return new RedissonMultiMapIterator<K, V, V>(RedissonSetMultimap.this, commandExecutor, codec) {
@Override
V getValue(V entry) {
return (V) entry;
Expand All @@ -432,25 +432,25 @@ V getValue(V entry) {

@Override
public boolean contains(Object o) {
return RedissonSetMultiMap.this.containsValue(o);
return RedissonSetMultimap.this.containsValue(o);
}

@Override
public int size() {
return RedissonSetMultiMap.this.size();
return RedissonSetMultimap.this.size();
}

@Override
public void clear() {
RedissonSetMultiMap.this.clear();
RedissonSetMultimap.this.clear();
}

}

final class EntrySet extends AbstractSet<Map.Entry<K,V>> {

public final Iterator<Map.Entry<K,V>> iterator() {
return new RedissonMultiMapIterator<K, V, Map.Entry<K, V>>(RedissonSetMultiMap.this, commandExecutor, codec);
return new RedissonMultiMapIterator<K, V, Map.Entry<K, V>>(RedissonSetMultimap.this, commandExecutor, codec);
}

public final boolean contains(Object o) {
Expand All @@ -465,17 +465,17 @@ public final boolean remove(Object o) {
Map.Entry<?,?> e = (Map.Entry<?,?>) o;
Object key = e.getKey();
Object value = e.getValue();
return RedissonSetMultiMap.this.remove(key, value);
return RedissonSetMultimap.this.remove(key, value);
}
return false;
}

public final int size() {
return RedissonSetMultiMap.this.size();
return RedissonSetMultimap.this.size();
}

public final void clear() {
RedissonSetMultiMap.this.clear();
RedissonSetMultimap.this.clear();
}

}
Expand Down
Expand Up @@ -27,7 +27,7 @@
* @param <K> key
* @param <V> value
*/
public interface RMultiMap<K, V> extends RExpirable, RMultiMapAsync<K, V> {
public interface RMultimap<K, V> extends RExpirable, RMultimapAsync<K, V> {

/**
* Returns the number of key-value pairs in this multimap.
Expand Down
Expand Up @@ -27,7 +27,7 @@
* @param <V> value
*/

public interface RMultiMapAsync<K, V> extends RExpirableAsync {
public interface RMultimapAsync<K, V> extends RExpirableAsync {

/**
* Returns the number of key-value pairs in this multimap.
Expand Down
Expand Up @@ -26,14 +26,14 @@
* @param <K> key
* @param <V> value
*/
public interface RSetMultiMap<K, V> extends RMultiMap<K, V> {
public interface RSetMultimap<K, V> extends RMultimap<K, V> {

/**
* {@inheritDoc}
*
* <p>Because a {@code RSetMultiMap} has unique values for a given key, this
* method returns a {@link Set}, instead of the {@link java.util.Collection}
* specified in the {@link RMultiMap} interface.
* specified in the {@link RMultimap} interface.
*/
@Override
Set<V> get(K key);
Expand All @@ -45,7 +45,7 @@ public interface RSetMultiMap<K, V> extends RMultiMap<K, V> {
*
* <p>Because a {@code RSetMultiMap} has unique values for a given key, this
* method returns a {@link Set}, instead of the {@link java.util.Collection}
* specified in the {@link RMultiMap} interface.
* specified in the {@link RMultimap} interface.
*/
@Override
Set<V> removeAll(Object key);
Expand All @@ -55,7 +55,7 @@ public interface RSetMultiMap<K, V> extends RMultiMap<K, V> {
*
* <p>Because a {@code RSetMultiMap} has unique values for a given key, this
* method returns a {@link Set}, instead of the {@link java.util.Collection}
* specified in the {@link RMultiMap} interface.
* specified in the {@link RMultimap} interface.
*
* <p>Any duplicates in {@code values} will be stored in the multimap once.
*/
Expand All @@ -67,7 +67,7 @@ public interface RSetMultiMap<K, V> extends RMultiMap<K, V> {
*
* <p>Because a {@code RSetMultiMap} has unique values for a given key, this
* method returns a {@link Set}, instead of the {@link java.util.Collection}
* specified in the {@link RMultiMap} interface.
* specified in the {@link RMultimap} interface.
*/
@Override
Set<Map.Entry<K, V>> entries();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/org/redisson/BaseTest.java
Expand Up @@ -26,8 +26,8 @@ public static Config createConfig() {
redisAddress = "127.0.0.1:6379";
}
Config config = new Config();
config.setCodec(new MsgPackJacksonCodec());
// config.useSentinelConnection().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26379", "127.0.0.1:26389");
// config.setCodec(new MsgPackJacksonCodec());
// config.useSentinelServers().setMasterName("mymaster").addSentinelAddress("127.0.0.1:26379", "127.0.0.1:26389");
// config.useClusterServers().addNodeAddress("127.0.0.1:7004", "127.0.0.1:7001", "127.0.0.1:7000");
config.useSingleServer().setAddress(redisAddress);
// .setPassword("mypass1");
Expand Down

0 comments on commit 9c67999

Please sign in to comment.