Esempio n. 1
0
  @Override
  public int compareTo(InvalidJob other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetWhat()).compareTo(other.isSetWhat());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhat()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.what, other.what);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetWhy()).compareTo(other.isSetWhy());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetWhy()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.why, other.why);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Esempio n. 2
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, InvalidJob struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(2);
   if (incoming.get(0)) {
     struct.what = iprot.readI32();
     struct.setWhatIsSet(true);
   }
   if (incoming.get(1)) {
     struct.why = iprot.readString();
     struct.setWhyIsSet(true);
   }
 }
Esempio n. 3
0
 /** Performs a deep copy on <i>other</i>. */
 public InvalidJob(InvalidJob other) {
   __isset_bitfield = other.__isset_bitfield;
   this.what = other.what;
   if (other.isSetWhy()) {
     this.why = other.why;
   }
 }
Esempio n. 4
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, InvalidJob struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetWhat()) {
     optionals.set(0);
   }
   if (struct.isSetWhy()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetWhat()) {
     oprot.writeI32(struct.what);
   }
   if (struct.isSetWhy()) {
     oprot.writeString(struct.why);
   }
 }
Esempio n. 5
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidJob 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: // WHAT
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.what = iprot.readI32();
              struct.setWhatIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // WHY
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.why = iprot.readString();
              struct.setWhyIsSet(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();
    }
Esempio n. 6
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidJob struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(WHAT_FIELD_DESC);
      oprot.writeI32(struct.what);
      oprot.writeFieldEnd();
      if (struct.why != null) {
        oprot.writeFieldBegin(WHY_FIELD_DESC);
        oprot.writeString(struct.why);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Esempio n. 7
0
  public boolean equals(InvalidJob that) {
    if (that == null) return false;

    boolean this_present_what = true;
    boolean that_present_what = true;
    if (this_present_what || that_present_what) {
      if (!(this_present_what && that_present_what)) return false;
      if (this.what != that.what) return false;
    }

    boolean this_present_why = true && this.isSetWhy();
    boolean that_present_why = true && that.isSetWhy();
    if (this_present_why || that_present_why) {
      if (!(this_present_why && that_present_why)) return false;
      if (!this.why.equals(that.why)) return false;
    }

    return true;
  }