コード例 #1
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, ConditionalUpdates struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetConditions()) {
     optionals.set(0);
   }
   if (struct.isSetUpdates()) {
     optionals.set(1);
   }
   oprot.writeBitSet(optionals, 2);
   if (struct.isSetConditions()) {
     {
       oprot.writeI32(struct.conditions.size());
       for (Condition _iter98 : struct.conditions) {
         _iter98.write(oprot);
       }
     }
   }
   if (struct.isSetUpdates()) {
     {
       oprot.writeI32(struct.updates.size());
       for (ColumnUpdate _iter99 : struct.updates) {
         _iter99.write(oprot);
       }
     }
   }
 }
コード例 #2
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, ConditionalUpdates struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.conditions != null) {
        oprot.writeFieldBegin(CONDITIONS_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.conditions.size()));
          for (Condition _iter96 : struct.conditions) {
            _iter96.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      if (struct.updates != null) {
        oprot.writeFieldBegin(UPDATES_FIELD_DESC);
        {
          oprot.writeListBegin(
              new org.apache.thrift.protocol.TList(
                  org.apache.thrift.protocol.TType.STRUCT, struct.updates.size()));
          for (ColumnUpdate _iter97 : struct.updates) {
            _iter97.write(oprot);
          }
          oprot.writeListEnd();
        }
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }