override equals method for SIPDialog

"Jens Tinfors" <[email protected]> Sun, 14 Oct 2007 19:40:55 +0200
Newsgroups gmane.comp.voip.nist-sip
Message-ID <[email protected]>
--===============9178951922798540067==
Content-Type: multipart/alternative; 
	boundary="----=_Part_17369_18768049.1192383655900"

------=_Part_17369_18768049.1192383655900
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,

Im overriding the boolean equals(Object o) method in SIPDialog in order to
be able to better compare Dialog objects..
Perhaps that is something you'd like to add to the cvs?

        public boolean equals(Object obj) {
            if (!obj.getClass().equals(this.getClass())) {
                return false;
            }
            if(obj != null && this.getDialogId() != null && !
this.getDialogId().equals("")) {
                return this.getDialogId
().equals(((Dialog)obj).getDialogId());
            } else {
                return true;
            }
        }

regards/jns =)

------=_Part_17369_18768049.1192383655900
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Hi,<br><br>Im overriding the boolean equals(Object o) method in SIPDialog in order to be able to better compare Dialog objects..<br>Perhaps that is something you&#39;d like to add to the cvs?<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public boolean equals(Object obj) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (!obj.getClass().equals(this.getClass())) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(obj != null &amp;&amp; this.getDialogId() != null &amp;&amp; ! this.getDialogId().equals(&quot;&quot;)) {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return this.getDialogId().equals(((Dialog)obj).getDialogId());<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br>regards/jns =)<br>

------=_Part_17369_18768049.1192383655900--

--===============9178951922798540067==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
nist-sip mailing list
[email protected]
http://www-x.antd.nist.gov/mailman/listinfo/nist-sip

--===============9178951922798540067==--