2021-01-23 18:49:21 +01:00
|
|
|
package it.tdlight.tdlibsession.td.middle;
|
|
|
|
|
2021-01-27 00:58:07 +01:00
|
|
|
import io.vertx.reactivex.core.buffer.Buffer;
|
2021-01-23 18:49:21 +01:00
|
|
|
import java.util.Objects;
|
2021-01-27 00:58:07 +01:00
|
|
|
import java.util.StringJoiner;
|
2021-01-23 18:49:21 +01:00
|
|
|
|
|
|
|
public final class EndSessionMessage {
|
|
|
|
|
|
|
|
private final int id;
|
2021-01-27 00:58:07 +01:00
|
|
|
private final Buffer binlog;
|
2021-01-23 18:49:21 +01:00
|
|
|
|
2021-01-27 00:58:07 +01:00
|
|
|
public EndSessionMessage(int id, Buffer binlog) {
|
2021-01-23 18:49:21 +01:00
|
|
|
this.id = id;
|
|
|
|
this.binlog = binlog;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int id() {
|
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:58:07 +01:00
|
|
|
public Buffer binlog() {
|
2021-01-23 18:49:21 +01:00
|
|
|
return binlog;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2021-01-27 00:58:07 +01:00
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o) {
|
2021-01-23 18:49:21 +01:00
|
|
|
return true;
|
|
|
|
}
|
2021-01-27 00:58:07 +01:00
|
|
|
if (o == null || getClass() != o.getClass()) {
|
2021-01-23 18:49:21 +01:00
|
|
|
return false;
|
|
|
|
}
|
2021-01-27 00:58:07 +01:00
|
|
|
EndSessionMessage that = (EndSessionMessage) o;
|
|
|
|
return id == that.id && Objects.equals(binlog, that.binlog);
|
2021-01-23 18:49:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
|
|
|
return Objects.hash(id, binlog);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
2021-01-27 00:58:07 +01:00
|
|
|
return new StringJoiner(", ", EndSessionMessage.class.getSimpleName() + "[", "]")
|
|
|
|
.add("id=" + id)
|
|
|
|
.add("binlog=" + binlog)
|
|
|
|
.toString();
|
2021-01-23 18:49:21 +01:00
|
|
|
}
|
|
|
|
}
|