1 21 22 package org.continuent.sequoia.driver; 23 24 32 public class ControllerInfo 33 { 34 private String hostname; 35 private int port; 36 37 40 public ControllerInfo() 41 { 42 } 43 44 50 public ControllerInfo(String hostname, int port) 51 { 52 this.hostname = hostname; 53 this.port = port; 54 } 55 56 61 public String getHostname() 62 { 63 return hostname; 64 } 65 66 71 public int getPort() 72 { 73 return port; 74 } 75 76 81 public void setHostname(String string) 82 { 83 hostname = string; 84 } 85 86 91 public void setPort(int port) 92 { 93 this.port = port; 94 } 95 96 99 public boolean equals(Object obj) 100 { 101 if (obj instanceof ControllerInfo) 102 { 103 ControllerInfo other = (ControllerInfo) obj; 104 return hostname.equals(other.getHostname()) && (port == other.port); 105 } 106 return false; 107 } 108 109 112 public int hashCode() 113 { 114 return hostname.hashCode(); 115 } 116 117 120 public String toString() 121 { 122 return hostname + ":" + port; 123 } 124 } | Popular Tags |