2015-01-15 13:35:35 -08:00
|
|
|
package org.thoughtcrime.securesms.database.documents;
|
|
|
|
|
2017-10-02 10:35:49 -07:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
2015-01-15 13:35:35 -08:00
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
|
|
|
2017-07-26 09:59:15 -07:00
|
|
|
import org.thoughtcrime.securesms.database.Address;
|
|
|
|
|
2015-01-15 13:35:35 -08:00
|
|
|
public class NetworkFailure {
|
|
|
|
|
2017-07-26 09:59:15 -07:00
|
|
|
@JsonProperty(value = "a")
|
|
|
|
private String address;
|
2015-01-15 13:35:35 -08:00
|
|
|
|
2017-07-26 09:59:15 -07:00
|
|
|
public NetworkFailure(Address address) {
|
|
|
|
this.address = address.serialize();
|
2015-01-15 13:35:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
public NetworkFailure() {}
|
|
|
|
|
2017-10-02 10:35:49 -07:00
|
|
|
@JsonIgnore
|
2017-07-26 09:59:15 -07:00
|
|
|
public Address getAddress() {
|
|
|
|
return Address.fromSerialized(address);
|
2015-01-15 13:35:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean equals(Object other) {
|
|
|
|
if (other == null || !(other instanceof NetworkFailure)) return false;
|
|
|
|
|
|
|
|
NetworkFailure that = (NetworkFailure)other;
|
2017-07-26 09:59:15 -07:00
|
|
|
return this.address.equals(that.address);
|
2015-01-15 13:35:35 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2017-07-26 09:59:15 -07:00
|
|
|
return address.hashCode();
|
2015-01-15 13:35:35 -08:00
|
|
|
}
|
|
|
|
}
|