Esempio n. 1
0
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, TExerciseType struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(5);
   if (incoming.get(0)) {
     struct.myid = iprot.readI32();
     struct.setMyidIsSet(true);
   }
   if (incoming.get(1)) {
     struct.typeName = iprot.readString();
     struct.setTypeNameIsSet(true);
   }
   if (incoming.get(2)) {
     struct.createAt = iprot.readString();
     struct.setCreateAtIsSet(true);
   }
   if (incoming.get(3)) {
     struct.updateAt = iprot.readString();
     struct.setUpdateAtIsSet(true);
   }
   if (incoming.get(4)) {
     struct.active = iprot.readBool();
     struct.setActiveIsSet(true);
   }
 }
Esempio n. 2
0
    public void read(org.apache.thrift.protocol.TProtocol iprot, TExerciseType 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: // MYID
            if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
              struct.myid = iprot.readI32();
              struct.setMyidIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TYPE_NAME
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.typeName = iprot.readString();
              struct.setTypeNameIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // CREATE_AT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.createAt = iprot.readString();
              struct.setCreateAtIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 4: // UPDATE_AT
            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
              struct.updateAt = iprot.readString();
              struct.setUpdateAtIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 5: // ACTIVE
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.active = iprot.readBool();
              struct.setActiveIsSet(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();
    }