@Override
  public int compareTo(ServerName other) {
    int compare;
    if (other == null) {
      return -1;
    }
    if (this.getHostname() == null) {
      if (other.getHostname() != null) {
        return 1;
      }
    } else {
      if (other.getHostname() == null) {
        return -1;
      }
      compare = this.getHostname().compareToIgnoreCase(other.getHostname());
      if (compare != 0) {
        return compare;
      }
    }
    compare = this.getPort() - other.getPort();
    if (compare != 0) {
      return compare;
    }
    return Long.compare(this.getStartCode(), other.getStartCode());
  }
For internal use only.
@param hostName  the name of the host to use
@param port      the port on the host to use
@param startCode the startcode to use for formatting
@return Server name made of the concatenation of hostname, port and startcode formatted as
        <code>&lt;hostname&gt; ',' &lt;port&gt; ',' &lt;startcode&gt;</code>
hbase-common/src/main/java/org/apache/hadoop/hbase/ServerName.java