Add equals and hashcode
This commit is contained in:
parent
02e9f2796f
commit
93b01456e5
14
headers.txt
14
headers.txt
@ -5,12 +5,26 @@ import java.nio.charset.StandardCharsets;
|
|||||||
import java.lang.IllegalStateException;
|
import java.lang.IllegalStateException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.DataInput;
|
import java.io.DataInput;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
|
||||||
public class TdApi {
|
public class TdApi {
|
||||||
public abstract static class Object {
|
public abstract static class Object {
|
||||||
public native String toString();
|
public native String toString();
|
||||||
|
|
||||||
|
public boolean equals(Object o) {
|
||||||
|
if (o == null) return false;
|
||||||
|
if (o == this) return true;
|
||||||
|
if (o instanceof Object) {
|
||||||
|
return Arrays.equals(this.serialize(), o.serialize());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int hashCode() {
|
||||||
|
return Arrays.hashCode(this.serialize());
|
||||||
|
}
|
||||||
|
|
||||||
public abstract int getConstructor();
|
public abstract int getConstructor();
|
||||||
|
|
||||||
public byte[] serialize() throws IOException {
|
public byte[] serialize() throws IOException {
|
||||||
|
Loading…
Reference in New Issue
Block a user