TransferBot/src/main/java/it/cavallium/BaseChatInfo.java
2020-10-19 19:13:55 +02:00

50 lines
901 B
Java

package it.cavallium;
import java.util.StringJoiner;
public class BaseChatInfo {
private final long supergroupId;
private final String title;
public BaseChatInfo(long supergroupId, String title) {
this.supergroupId = supergroupId;
this.title = title;
}
public long getSupergroupId() {
return supergroupId;
}
public int getSupergroupIdInt() {
return TransferUtils.chatIdToChatEntityId(supergroupId);
}
public String getTitle() {
return title;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BaseChatInfo that = (BaseChatInfo) o;
return supergroupId == that.supergroupId;
}
@Override
public int hashCode() {
return (int) (supergroupId ^ (supergroupId >>> 32));
}
@Override
public String toString() {
return (supergroupId + " " + title).trim();
}
}