refactoring

pull/5139/head
Nikita Koksharov 2 years ago
parent 86fdde634f
commit e774ae5d21

@ -17,6 +17,8 @@ package org.redisson.client.handler;
import org.redisson.client.ChannelName;
import java.util.Objects;
/**
*
* @author Nikita Koksharov
@ -42,35 +44,15 @@ public class PubSubKey {
}
@Override
@SuppressWarnings("AvoidInlineConditionals")
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((channel == null) ? 0 : channel.hashCode());
result = prime * result + ((operation == null) ? 0 : operation.hashCode());
return result;
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PubSubKey pubSubKey = (PubSubKey) o;
return Objects.equals(channel, pubSubKey.channel) && Objects.equals(operation, pubSubKey.operation);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
PubSubKey other = (PubSubKey) obj;
if (channel == null) {
if (other.channel != null)
return false;
} else if (!channel.equals(other.channel))
return false;
if (operation == null) {
if (other.operation != null)
return false;
} else if (!operation.equals(other.operation))
return false;
return true;
public int hashCode() {
return Objects.hash(channel, operation);
}
}

@ -649,9 +649,9 @@ public interface RedisCommands {
RedisCommand<Object> PSUBSCRIBE = new RedisCommand<Object>("PSUBSCRIBE", new PubSubStatusDecoder());
RedisCommand<Object> PUNSUBSCRIBE = new RedisCommand<Object>("PUNSUBSCRIBE", new PubSubStatusDecoder());
Set<String> PUBSUB_COMMANDS = new HashSet<String>(
Set<String> PUBSUB_COMMANDS = Collections.unmodifiableSet(new HashSet<>(
Arrays.asList(PSUBSCRIBE.getName(), SUBSCRIBE.getName(), PUNSUBSCRIBE.getName(),
UNSUBSCRIBE.getName(), SSUBSCRIBE.getName(), SUNSUBSCRIBE.getName()));
UNSUBSCRIBE.getName(), SSUBSCRIBE.getName(), SUNSUBSCRIBE.getName())));
Set<String> SCAN_COMMANDS = new HashSet<String>(
Arrays.asList(HSCAN.getName(), SCAN.getName(), ZSCAN.getName(), SSCAN.getName()));

Loading…
Cancel
Save