2021-01-23 18:49:21 +01:00
|
|
|
package it.tdlight.tdlibsession.td.middle;
|
|
|
|
|
2021-01-24 19:13:46 +01:00
|
|
|
import io.vertx.core.json.JsonObject;
|
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;
|
|
|
|
import java.util.StringJoiner;
|
|
|
|
|
|
|
|
public final class StartSessionMessage {
|
|
|
|
|
2021-03-10 12:35:56 +01:00
|
|
|
private final long id;
|
2021-01-23 18:49:21 +01:00
|
|
|
private final String alias;
|
2021-01-27 00:58:07 +01:00
|
|
|
private final Buffer binlog;
|
2021-01-23 18:49:21 +01:00
|
|
|
private final long binlogDate;
|
2021-01-24 19:13:46 +01:00
|
|
|
private final JsonObject implementationDetails;
|
2021-01-23 18:49:21 +01:00
|
|
|
|
2021-03-10 12:35:56 +01:00
|
|
|
public StartSessionMessage(long id, String alias, Buffer binlog, long binlogDate, JsonObject implementationDetails) {
|
2021-01-23 18:49:21 +01:00
|
|
|
this.id = id;
|
|
|
|
this.alias = alias;
|
|
|
|
this.binlog = binlog;
|
|
|
|
this.binlogDate = binlogDate;
|
2021-01-24 19:13:46 +01:00
|
|
|
this.implementationDetails = implementationDetails;
|
2021-01-23 18:49:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-10 12:35:56 +01:00
|
|
|
public long id() {
|
2021-01-23 18:49:21 +01:00
|
|
|
return id;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String alias() {
|
|
|
|
return alias;
|
|
|
|
}
|
|
|
|
|
2021-01-27 00:58:07 +01:00
|
|
|
public Buffer binlog() {
|
2021-01-23 18:49:21 +01:00
|
|
|
return binlog;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long binlogDate() {
|
|
|
|
return binlogDate;
|
|
|
|
}
|
|
|
|
|
2021-01-24 19:13:46 +01:00
|
|
|
public JsonObject implementationDetails() {
|
|
|
|
return implementationDetails;
|
|
|
|
}
|
|
|
|
|
2021-01-23 18:49:21 +01:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (o == null || getClass() != o.getClass()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
StartSessionMessage that = (StartSessionMessage) o;
|
2021-01-27 00:58:07 +01:00
|
|
|
return id == that.id && binlogDate == that.binlogDate && Objects.equals(alias, that.alias) && Objects.equals(binlog,
|
|
|
|
that.binlog
|
|
|
|
) && Objects.equals(implementationDetails, that.implementationDetails);
|
2021-01-23 18:49:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2021-01-27 00:58:07 +01:00
|
|
|
return Objects.hash(id, alias, binlog, binlogDate, implementationDetails);
|
2021-01-23 18:49:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return new StringJoiner(", ", StartSessionMessage.class.getSimpleName() + "[", "]")
|
|
|
|
.add("id=" + id)
|
|
|
|
.add("alias='" + alias + "'")
|
2021-01-27 00:58:07 +01:00
|
|
|
.add("binlog=" + binlog)
|
2021-01-23 18:49:21 +01:00
|
|
|
.add("binlogDate=" + binlogDate)
|
2021-01-24 19:13:46 +01:00
|
|
|
.add("implementationDetails=" + implementationDetails)
|
2021-01-23 18:49:21 +01:00
|
|
|
.toString();
|
|
|
|
}
|
|
|
|
}
|