Exemplo n.º 1
0
  public boolean equals(DeadServer that) {
    if (that == null) return false;

    boolean this_present_server = true && this.isSetServer();
    boolean that_present_server = true && that.isSetServer();
    if (this_present_server || that_present_server) {
      if (!(this_present_server && that_present_server)) return false;
      if (!this.server.equals(that.server)) return false;
    }

    boolean this_present_lastStatus = true;
    boolean that_present_lastStatus = true;
    if (this_present_lastStatus || that_present_lastStatus) {
      if (!(this_present_lastStatus && that_present_lastStatus)) return false;
      if (this.lastStatus != that.lastStatus) return false;
    }

    boolean this_present_status = true && this.isSetStatus();
    boolean that_present_status = true && that.isSetStatus();
    if (this_present_status || that_present_status) {
      if (!(this_present_status && that_present_status)) return false;
      if (!this.status.equals(that.status)) return false;
    }

    return true;
  }
Exemplo n.º 2
0
 /** Performs a deep copy on <i>other</i>. */
 public DeadServer(DeadServer other) {
   __isset_bitfield = other.__isset_bitfield;
   if (other.isSetServer()) {
     this.server = other.server;
   }
   this.lastStatus = other.lastStatus;
   if (other.isSetStatus()) {
     this.status = other.status;
   }
 }
Exemplo n.º 3
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, DeadServer struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetServer()) {
     optionals.set(0);
   }
   if (struct.isSetLastStatus()) {
     optionals.set(1);
   }
   if (struct.isSetStatus()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetServer()) {
     oprot.writeString(struct.server);
   }
   if (struct.isSetLastStatus()) {
     oprot.writeI64(struct.lastStatus);
   }
   if (struct.isSetStatus()) {
     oprot.writeString(struct.status);
   }
 }
Exemplo n.º 4
0
  @Override
  public int compareTo(DeadServer other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetServer()).compareTo(other.isSetServer());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetServer()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.server, other.server);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetLastStatus()).compareTo(other.isSetLastStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetLastStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastStatus, other.lastStatus);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetStatus()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemplo n.º 5
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, DeadServer struct)
        throws org.apache.thrift.TException {
      org.apache.thrift.protocol.TField schemeField;
      iprot.readStructBegin();
      while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
          break;
        }
        switch (schemeField.id) {
          case 1: // SERVER
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.server = iprot.readString();
              struct.setServerIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // LAST_STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.lastStatus = iprot.readI64();
              struct.setLastStatusIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // STATUS
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.status = iprot.readString();
              struct.setStatusIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      // check for required fields of primitive type, which can't be checked in the validate method
      struct.validate();
    }
Exemplo n.º 6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, DeadServer struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.server != null) {
        oprot.writeFieldBegin(SERVER_FIELD_DESC);
        oprot.writeString(struct.server);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(LAST_STATUS_FIELD_DESC);
      oprot.writeI64(struct.lastStatus);
      oprot.writeFieldEnd();
      if (struct.status != null) {
        oprot.writeFieldBegin(STATUS_FIELD_DESC);
        oprot.writeString(struct.status);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Exemplo n.º 7
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, DeadServer struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.server = iprot.readString();
     struct.setServerIsSet(true);
   }
   if (incoming.get(1)) {
     struct.lastStatus = iprot.readI64();
     struct.setLastStatusIsSet(true);
   }
   if (incoming.get(2)) {
     struct.status = iprot.readString();
     struct.setStatusIsSet(true);
   }
 }