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