broker/Subscription: code formatter used

This commit is contained in:
Andreas Mager
2017-02-01 17:13:40 +01:00
parent 3bbec46585
commit fdf5a83386
@@ -13,16 +13,15 @@
* *
* You may elect to redistribute this code under either of these licenses. * You may elect to redistribute this code under either of these licenses.
*/ */
package io.moquette.spi.impl.subscriptions; package io.moquette.spi.impl.subscriptions;
import io.moquette.spi.ISessionsStore.ClientTopicCouple; import io.moquette.spi.ISessionsStore.ClientTopicCouple;
import io.netty.handler.codec.mqtt.MqttQoS; import io.netty.handler.codec.mqtt.MqttQoS;
import java.io.Serializable; import java.io.Serializable;
/** /**
* Maintain the information about which Topic a certain ClientID is subscribed * Maintain the information about which Topic a certain ClientID is subscribed and at which QoS
* and at which QoS
* *
* *
* @author andrea * @author andrea
@@ -30,7 +29,7 @@ import java.io.Serializable;
public final class Subscription implements Serializable { public final class Subscription implements Serializable {
private static final long serialVersionUID = -3383457629635732794L; private static final long serialVersionUID = -3383457629635732794L;
final MqttQoS requestedQos; //max QoS acceptable final MqttQoS requestedQos; // max QoS acceptable
final String clientId; final String clientId;
final String topicFilter; final String topicFilter;
final boolean active; final boolean active;
@@ -67,12 +66,15 @@ public final class Subscription implements Serializable {
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o)
if (o == null || getClass() != o.getClass()) return false; return true;
if (o == null || getClass() != o.getClass())
return false;
Subscription that = (Subscription) o; Subscription that = (Subscription) o;
if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null) return false; if (clientId != null ? !clientId.equals(that.clientId) : that.clientId != null)
return false;
return !(topicFilter != null ? !topicFilter.equals(that.topicFilter) : that.topicFilter != null); return !(topicFilter != null ? !topicFilter.equals(that.topicFilter) : that.topicFilter != null);
} }
@@ -86,8 +88,12 @@ public final class Subscription implements Serializable {
@Override @Override
public String toString() { public String toString() {
return String.format("[filter:%s, cliID: %s, qos: %s, active: %s]", this.topicFilter, this.clientId, return String.format(
this.requestedQos, this.active); "[filter:%s, cliID: %s, qos: %s, active: %s]",
this.topicFilter,
this.clientId,
this.requestedQos,
this.active);
} }
@Override @Override