From 04bf051e92fb7dce561278b315961e790b545803 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 3 May 2008 16:22:33 +0000 Subject: [PATCH] add equals(Object) git-svn-id: http://trooper/svn/projects/jSite/trunk@781 c3eda9e8-030b-0410-8277-bc7414b0a119 --- src/net/pterodactylus/jsite/core/Node.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- 2.7.4