From: David ‘Bombe’ Roden Date: Sat, 3 May 2008 16:22:33 +0000 (+0000) Subject: add equals(Object) X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=04bf051e92fb7dce561278b315961e790b545803;p=jSite2.git add equals(Object) git-svn-id: http://trooper/svn/projects/jSite/trunk@781 c3eda9e8-030b-0410-8277-bc7414b0a119 --- diff --git a/src/net/pterodactylus/jsite/core/Node.java b/src/net/pterodactylus/jsite/core/Node.java index 468a256..b3a98e9 100644 --- a/src/net/pterodactylus/jsite/core/Node.java +++ b/src/net/pterodactylus/jsite/core/Node.java @@ -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