public boolean isOK() { return getReplyCode() == REPLY_OK; }
/** * Indicates whether some other object is "equal to" this one. * * @param other the reference object with which to compare. * @return true if this object is the same as the obj argument; false otherwise. */ @Override public boolean equals(Object other) { if (other == this) return true; if (!(other instanceof Handshake)) return false; final Handshake that = (Handshake) other; if (this.id.isSameDSMember(that.id) && getReplyCode() == that.getReplyCode()) { return true; } else { return false; } }
@Override public int hashCode() { final int mult = 37; int result = this.id.hashCode(); result = mult * result + getReplyCode(); return result; }
@Override public String toString() { StringBuffer buf = new StringBuffer().append("HandShake@").append(System.identityHashCode(this)) .append(" code: ").append(getReplyCode()); if (this.id != null) { buf.append(" identity: "); buf.append(this.id.toString()); } return buf.toString(); }