1 23 24 package org.objectweb.cjdbc.driver; 25 26 34 public class ControllerInfo 35 { 36 private String hostname; 37 private int port; 38 39 42 public ControllerInfo() 43 { 44 } 45 46 52 public ControllerInfo(String hostname, int port) 53 { 54 this.hostname = hostname; 55 this.port = port; 56 } 57 58 63 public String getHostname() 64 { 65 return hostname; 66 } 67 68 73 public int getPort() 74 { 75 return port; 76 } 77 78 83 public void setHostname(String string) 84 { 85 hostname = string; 86 } 87 88 93 public void setPort(int port) 94 { 95 this.port = port; 96 } 97 98 101 public boolean equals(Object obj) 102 { 103 if (obj instanceof ControllerInfo) 104 { 105 ControllerInfo other = (ControllerInfo) obj; 106 return hostname.equals(other.getHostname()) && (port == other.port); 107 } 108 return false; 109 } 110 111 114 public String toString() 115 { 116 return hostname + ":" + port; 117 } 118 } | Popular Tags |