com.alibaba.rocketmq.common.protocol.route.QueueData Maven / Gradle / Ivy
/**
* $Id: QueueData.java 1835 2013-05-16 02:00:50Z shijia.wxr $
*/
package com.alibaba.rocketmq.common.protocol.route;
public class QueueData implements Comparable {
private String brokerName;
private int readQueueNums;
private int writeQueueNums;
private int perm;
private int topicSynFlag;
public int getReadQueueNums() {
return readQueueNums;
}
public void setReadQueueNums(int readQueueNums) {
this.readQueueNums = readQueueNums;
}
public int getWriteQueueNums() {
return writeQueueNums;
}
public void setWriteQueueNums(int writeQueueNums) {
this.writeQueueNums = writeQueueNums;
}
public int getPerm() {
return perm;
}
public void setPerm(int perm) {
this.perm = perm;
}
public int getTopicSynFlag() {
return topicSynFlag;
}
public void setTopicSynFlag(int topicSynFlag) {
this.topicSynFlag = topicSynFlag;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((brokerName == null) ? 0 : brokerName.hashCode());
result = prime * result + perm;
result = prime * result + readQueueNums;
result = prime * result + writeQueueNums;
result = prime * result + topicSynFlag;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
QueueData other = (QueueData) obj;
if (brokerName == null) {
if (other.brokerName != null)
return false;
} else if (!brokerName.equals(other.brokerName))
return false;
if (perm != other.perm)
return false;
if (readQueueNums != other.readQueueNums)
return false;
if (writeQueueNums != other.writeQueueNums)
return false;
if (topicSynFlag != other.topicSynFlag)
return false;
return true;
}
@Override
public String toString() {
return "QueueData [brokerName=" + brokerName + ", readQueueNums=" + readQueueNums
+ ", writeQueueNums=" + writeQueueNums + ", perm=" + perm + ", topicSynFlag=" + topicSynFlag
+ "]";
}
@Override
public int compareTo(QueueData o) {
return this.brokerName.compareTo(o.getBrokerName());
}
public String getBrokerName() {
return brokerName;
}
public void setBrokerName(String brokerName) {
this.brokerName = brokerName;
}
}