示例#1
0
  @Override
  public int compareTo(NimbusSummary other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(is_set_host()).compareTo(other.is_set_host());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_host()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, other.host);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_port()).compareTo(other.is_set_port());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_port()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, other.port);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_uptime_secs()).compareTo(other.is_set_uptime_secs());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_uptime_secs()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.uptime_secs, other.uptime_secs);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_isLeader()).compareTo(other.is_set_isLeader());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_isLeader()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isLeader, other.isLeader);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(is_set_version()).compareTo(other.is_set_version());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (is_set_version()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
示例#2
0
 /** Performs a deep copy on <i>other</i>. */
 public NimbusSummary(NimbusSummary other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.is_set_host()) {
     this.host = other.host;
   }
   this.port = other.port;
   this.uptime_secs = other.uptime_secs;
   this.isLeader = other.isLeader;
   if (other.is_set_version()) {
     this.version = other.version;
   }
 }
示例#3
0
  public boolean equals(NimbusSummary that) {
    if (that == null) return false;

    boolean this_present_host = true && this.is_set_host();
    boolean that_present_host = true && that.is_set_host();
    if (this_present_host || that_present_host) {
      if (!(this_present_host && that_present_host)) return false;
      if (!this.host.equals(that.host)) return false;
    }

    boolean this_present_port = true;
    boolean that_present_port = true;
    if (this_present_port || that_present_port) {
      if (!(this_present_port && that_present_port)) return false;
      if (this.port != that.port) return false;
    }

    boolean this_present_uptime_secs = true;
    boolean that_present_uptime_secs = true;
    if (this_present_uptime_secs || that_present_uptime_secs) {
      if (!(this_present_uptime_secs && that_present_uptime_secs)) return false;
      if (this.uptime_secs != that.uptime_secs) return false;
    }

    boolean this_present_isLeader = true;
    boolean that_present_isLeader = true;
    if (this_present_isLeader || that_present_isLeader) {
      if (!(this_present_isLeader && that_present_isLeader)) return false;
      if (this.isLeader != that.isLeader) return false;
    }

    boolean this_present_version = true && this.is_set_version();
    boolean that_present_version = true && that.is_set_version();
    if (this_present_version || that_present_version) {
      if (!(this_present_version && that_present_version)) return false;
      if (!this.version.equals(that.version)) return false;
    }

    return true;
  }