1 19 package fr.dyade.aaa.agent.conf; 20 21 import java.io.*; 22 23 26 public class A3CMLNetwork implements Serializable { 27 public String domain = null; 28 public int port = -1; 29 30 public A3CMLNetwork(String domain, 31 int port) { 32 this.domain = domain; 33 this.port = port; 34 } 35 36 public A3CMLNetwork duplicate() throws Exception { 37 A3CMLNetwork clone = new A3CMLNetwork(domain, port); 38 return clone; 39 } 40 41 public String toString() { 42 StringBuffer strBuf = new StringBuffer (); 43 strBuf.append("(").append(super.toString()); 44 strBuf.append(",domain=").append(domain); 45 strBuf.append(",port=").append(port); 46 strBuf.append(")"); 47 return strBuf.toString(); 48 } 49 50 public boolean equals(Object obj) { 51 if (obj == null) return false; 52 53 if (obj instanceof A3CMLNetwork) { 54 A3CMLNetwork network = (A3CMLNetwork) obj; 55 if (((domain == network.domain) || 56 ((domain != null) && domain.equals(network.domain))) && 57 (port == network.port)) 58 return true; 59 } 60 return false; 61 } 62 } 63 | Popular Tags |