예제 #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, AppInfoResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetDeviceId()) {
     optionals.set(0);
   }
   if (struct.isSetFlowNum()) {
     optionals.set(1);
   }
   if (struct.isSetResult()) {
     optionals.set(2);
   }
   if (struct.isSetAppdatainfo()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetDeviceId()) {
     oprot.writeI32(struct.deviceId);
   }
   if (struct.isSetFlowNum()) {
     oprot.writeI32(struct.flowNum);
   }
   if (struct.isSetResult()) {
     oprot.writeBool(struct.result);
   }
   if (struct.isSetAppdatainfo()) {
     struct.appdatainfo.write(oprot);
   }
 }
예제 #2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, AppInfoResult 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: // DEVICE_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.deviceId = iprot.readI32();
              struct.setDeviceIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // FLOW_NUM
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.flowNum = iprot.readI32();
              struct.setFlowNumIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // RESULT
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.result = iprot.readBool();
              struct.setResultIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // APPDATAINFO
            if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
              struct.appdatainfo = new AppDataInfo();
              struct.appdatainfo.read(iprot);
              struct.setAppdatainfoIsSet(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();
    }
예제 #3
0
  public boolean equals(AppInfoResult that) {
    if (that == null) return false;

    boolean this_present_deviceId = true;
    boolean that_present_deviceId = true;
    if (this_present_deviceId || that_present_deviceId) {
      if (!(this_present_deviceId && that_present_deviceId)) return false;
      if (this.deviceId != that.deviceId) return false;
    }

    boolean this_present_flowNum = true;
    boolean that_present_flowNum = true;
    if (this_present_flowNum || that_present_flowNum) {
      if (!(this_present_flowNum && that_present_flowNum)) return false;
      if (this.flowNum != that.flowNum) return false;
    }

    boolean this_present_result = true;
    boolean that_present_result = true;
    if (this_present_result || that_present_result) {
      if (!(this_present_result && that_present_result)) return false;
      if (this.result != that.result) return false;
    }

    boolean this_present_appdatainfo = true && this.isSetAppdatainfo();
    boolean that_present_appdatainfo = true && that.isSetAppdatainfo();
    if (this_present_appdatainfo || that_present_appdatainfo) {
      if (!(this_present_appdatainfo && that_present_appdatainfo)) return false;
      if (!this.appdatainfo.equals(that.appdatainfo)) return false;
    }

    return true;
  }
예제 #4
0
 /** Performs a deep copy on <i>other</i>. */
 public AppInfoResult(AppInfoResult other) {
   __isset_bit_vector.clear();
   __isset_bit_vector.or(other.__isset_bit_vector);
   this.deviceId = other.deviceId;
   this.flowNum = other.flowNum;
   this.result = other.result;
   if (other.isSetAppdatainfo()) {
     this.appdatainfo = new AppDataInfo(other.appdatainfo);
   }
 }
예제 #5
0
  public int compareTo(AppInfoResult other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;
    AppInfoResult typedOther = (AppInfoResult) other;

    lastComparison = Boolean.valueOf(isSetDeviceId()).compareTo(typedOther.isSetDeviceId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetDeviceId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.deviceId, typedOther.deviceId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetFlowNum()).compareTo(typedOther.isSetFlowNum());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetFlowNum()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.flowNum, typedOther.flowNum);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetResult()).compareTo(typedOther.isSetResult());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetResult()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.result, typedOther.result);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetAppdatainfo()).compareTo(typedOther.isSetAppdatainfo());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetAppdatainfo()) {
      lastComparison =
          org.apache.thrift.TBaseHelper.compareTo(this.appdatainfo, typedOther.appdatainfo);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
예제 #6
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, AppInfoResult struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(4);
   if (incoming.get(0)) {
     struct.deviceId = iprot.readI32();
     struct.setDeviceIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.flowNum = iprot.readI32();
     struct.setFlowNumIsSet(true);
   }
   if (incoming.get(2)) {
     struct.result = iprot.readBool();
     struct.setResultIsSet(true);
   }
   if (incoming.get(3)) {
     struct.appdatainfo = new AppDataInfo();
     struct.appdatainfo.read(iprot);
     struct.setAppdatainfoIsSet(true);
   }
 }
예제 #7
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, AppInfoResult struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(DEVICE_ID_FIELD_DESC);
      oprot.writeI32(struct.deviceId);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(FLOW_NUM_FIELD_DESC);
      oprot.writeI32(struct.flowNum);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(RESULT_FIELD_DESC);
      oprot.writeBool(struct.result);
      oprot.writeFieldEnd();
      if (struct.appdatainfo != null) {
        oprot.writeFieldBegin(APPDATAINFO_FIELD_DESC);
        struct.appdatainfo.write(oprot);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }