@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + message; result = prime * result + ((receiver == null) ? 0 : receiver.hashCode()); result = prime * result + ((sender == null) ? 0 : sender.hashCode()); result = prime * result + Float.floatToIntBits(timestamp); return result; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Telegram other = (Telegram) obj; if (message != other.message) return false; if (Float.floatToIntBits(timestamp) != Float.floatToIntBits(other.timestamp)) return false; if (sender == null) { if (other.sender != null) return false; } else if (!sender.equals(other.sender)) return false; if (receiver == null) { if (other.receiver != null) return false; } else if (!receiver.equals(other.receiver)) return false; return true; }