1 5 package com.tc.cluster; 6 7 public class Node { 8 private final String nodeId; 9 10 public Node(final String nodeId) { 11 this.nodeId = nodeId; 12 } 13 14 public String getNodeId() { 15 return nodeId; 16 } 17 18 public boolean equals(Object obj) { 19 if (!(obj instanceof Node)) return false; 20 Node that = (Node) obj; 21 return this.nodeId.equals(that.nodeId); 22 } 23 24 public int hashCode() { 25 return nodeId.hashCode(); 26 } 27 28 public String toString() { 29 return nodeId; 30 } 31 } 32 | Popular Tags |