コード例 #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, BankGroupThrift struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetId()) {
     optionals.set(0);
   }
   if (struct.isSetGroupType()) {
     optionals.set(1);
   }
   if (struct.isSetBankId()) {
     optionals.set(2);
   }
   if (struct.isSetBankCode()) {
     optionals.set(3);
   }
   oprot.writeBitSet(optionals, 4);
   if (struct.isSetId()) {
     oprot.writeI32(struct.id);
   }
   if (struct.isSetGroupType()) {
     oprot.writeI32(struct.groupType);
   }
   if (struct.isSetBankId()) {
     oprot.writeI32(struct.bankId);
   }
   if (struct.isSetBankCode()) {
     oprot.writeString(struct.bankCode);
   }
 }
コード例 #2
0
  public boolean equals(BankGroupThrift that) {
    if (that == null) return false;

    boolean this_present_id = true;
    boolean that_present_id = true;
    if (this_present_id || that_present_id) {
      if (!(this_present_id && that_present_id)) return false;
      if (this.id != that.id) return false;
    }

    boolean this_present_groupType = true;
    boolean that_present_groupType = true;
    if (this_present_groupType || that_present_groupType) {
      if (!(this_present_groupType && that_present_groupType)) return false;
      if (this.groupType != that.groupType) return false;
    }

    boolean this_present_bankId = true;
    boolean that_present_bankId = true;
    if (this_present_bankId || that_present_bankId) {
      if (!(this_present_bankId && that_present_bankId)) return false;
      if (this.bankId != that.bankId) return false;
    }

    boolean this_present_bankCode = true && this.isSetBankCode();
    boolean that_present_bankCode = true && that.isSetBankCode();
    if (this_present_bankCode || that_present_bankCode) {
      if (!(this_present_bankCode && that_present_bankCode)) return false;
      if (!this.bankCode.equals(that.bankCode)) return false;
    }

    return true;
  }
コード例 #3
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, BankGroupThrift 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: // ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.id = iprot.readI32();
              struct.setIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // GROUP_TYPE
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.groupType = iprot.readI32();
              struct.setGroupTypeIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // BANK_ID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.bankId = iprot.readI32();
              struct.setBankIdIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // BANK_CODE
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.bankCode = iprot.readString();
              struct.setBankCodeIsSet(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();
    }
コード例 #4
0
 /** Performs a deep copy on <i>other</i>. */
 public BankGroupThrift(BankGroupThrift other) {
   __isset_bitfield = other.__isset_bitfield;
   this.id = other.id;
   this.groupType = other.groupType;
   this.bankId = other.bankId;
   if (other.isSetBankCode()) {
     this.bankCode = other.bankCode;
   }
 }
コード例 #5
0
  @Override
  public int compareTo(BankGroupThrift other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetGroupType()).compareTo(other.isSetGroupType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetGroupType()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groupType, other.groupType);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBankId()).compareTo(other.isSetBankId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBankId()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bankId, other.bankId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetBankCode()).compareTo(other.isSetBankCode());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetBankCode()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.bankCode, other.bankCode);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
コード例 #6
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, BankGroupThrift struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(4);
   if (incoming.get(0)) {
     struct.id = iprot.readI32();
     struct.setIdIsSet(true);
   }
   if (incoming.get(1)) {
     struct.groupType = iprot.readI32();
     struct.setGroupTypeIsSet(true);
   }
   if (incoming.get(2)) {
     struct.bankId = iprot.readI32();
     struct.setBankIdIsSet(true);
   }
   if (incoming.get(3)) {
     struct.bankCode = iprot.readString();
     struct.setBankCodeIsSet(true);
   }
 }
コード例 #7
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, BankGroupThrift struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(ID_FIELD_DESC);
      oprot.writeI32(struct.id);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(GROUP_TYPE_FIELD_DESC);
      oprot.writeI32(struct.groupType);
      oprot.writeFieldEnd();
      oprot.writeFieldBegin(BANK_ID_FIELD_DESC);
      oprot.writeI32(struct.bankId);
      oprot.writeFieldEnd();
      if (struct.bankCode != null) {
        oprot.writeFieldBegin(BANK_CODE_FIELD_DESC);
        oprot.writeString(struct.bankCode);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }