add equals(Object)
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 3 May 2008 16:22:33 +0000 (16:22 +0000)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 3 May 2008 16:22:33 +0000 (16:22 +0000)
git-svn-id: http://trooper/svn/projects/jSite/trunk@781 c3eda9e8-030b-0410-8277-bc7414b0a119

src/net/pterodactylus/jsite/core/Node.java

index 468a256..b3a98e9 100644 (file)
@@ -94,6 +94,19 @@ public class Node {
        }
 
        /**
+        * {@inheritDoc} Two Node objects are considered equal if their hostnames
+        * and their port numbers are equal.
+        */
+       @Override
+       public boolean equals(Object object) {
+               if ((object == null) || !(object instanceof Node)) {
+                       return false;
+               }
+               Node node = (Node) object;
+               return hostname.equals(node.hostname) && port == node.port;
+       }
+
+       /**
         * {@inheritDoc}
         */
        @Override