override standard Object methods of DcContact

This commit is contained in:
B. Petersen
2018-09-17 00:14:43 +02:00
parent 674ad7861c
commit e10fe6ede0
+18 -1
View File
@@ -34,12 +34,29 @@ public class DcContact {
this.contactCPtr = contactCPtr;
}
@Override protected void finalize() throws Throwable {
@Override
protected void finalize() throws Throwable {
super.finalize();
unrefContactCPtr();
contactCPtr = 0;
}
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof DcContact)) {
return false;
}
DcContact that = (DcContact) other;
return this.getId()==that.getId();
}
@Override
public String toString() {
return getAddr();
}
public native int getId ();
public native String getName ();
public native String getDisplayName();