예제 #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);
   }
 }
예제 #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();
    }
예제 #3
0
 @Override
 public void clear() {
   setMyidIsSet(false);
   this.myid = 0;
   this.typeName = null;
   this.createAt = null;
   this.updateAt = null;
   setActiveIsSet(false);
   this.active = false;
 }
예제 #4
0
 public TExerciseType(
     int myid, String typeName, String createAt, String updateAt, boolean active) {
   this();
   this.myid = myid;
   setMyidIsSet(true);
   this.typeName = typeName;
   this.createAt = createAt;
   this.updateAt = updateAt;
   this.active = active;
   setActiveIsSet(true);
 }
예제 #5
0
 public TExerciseType setActive(boolean active) {
   this.active = active;
   setActiveIsSet(true);
   return this;
 }