@Override public boolean equals(Object obj) { if (obj.getClass() != SipTransportConnection.class) { return false; } SipTransportConnection other = (SipTransportConnection) obj; if (!transport.equalsIgnoreCase(other.transport)) { return false; } if (RFC3261.TRANSPORT_UDP.equalsIgnoreCase(transport)) { return localInetAddress.equals(other.localInetAddress) && localPort == other.localPort; } return false; }
@Override public String toString() { StringBuffer buf = new StringBuffer(); appendInetAddress(buf, localInetAddress); buf.append(':'); appendPort(buf, localPort); buf.append('/'); if (!RFC3261.TRANSPORT_UDP.equalsIgnoreCase(transport)) { appendInetAddress(buf, remoteInetAddress); buf.append(':'); appendPort(buf, remotePort); buf.append('/'); } buf.append(transport.toUpperCase()); return buf.toString(); }