Exemplo 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);
   }
 }
Exemplo n.º 2
0
 /** Performs a deep copy on <i>other</i>. */
 public TExerciseType(TExerciseType other) {
   __isset_bitfield = other.__isset_bitfield;
   this.myid = other.myid;
   if (other.isSetTypeName()) {
     this.typeName = other.typeName;
   }
   if (other.isSetCreateAt()) {
     this.createAt = other.createAt;
   }
   if (other.isSetUpdateAt()) {
     this.updateAt = other.updateAt;
   }
   this.active = other.active;
 }
Exemplo n.º 3
0
    public void write(org.apache.thrift.protocol.TProtocol oprot, TExerciseType struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      oprot.writeFieldBegin(MYID_FIELD_DESC);
      oprot.writeI32(struct.myid);
      oprot.writeFieldEnd();
      if (struct.typeName != null) {
        oprot.writeFieldBegin(TYPE_NAME_FIELD_DESC);
        oprot.writeString(struct.typeName);
        oprot.writeFieldEnd();
      }
      if (struct.createAt != null) {
        oprot.writeFieldBegin(CREATE_AT_FIELD_DESC);
        oprot.writeString(struct.createAt);
        oprot.writeFieldEnd();
      }
      if (struct.updateAt != null) {
        oprot.writeFieldBegin(UPDATE_AT_FIELD_DESC);
        oprot.writeString(struct.updateAt);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldBegin(ACTIVE_FIELD_DESC);
      oprot.writeBool(struct.active);
      oprot.writeFieldEnd();
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Exemplo n.º 4
0
  @Override
  public int compareTo(TExerciseType other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetMyid()).compareTo(other.isSetMyid());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetMyid()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.myid, other.myid);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTypeName()).compareTo(other.isSetTypeName());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTypeName()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.typeName, other.typeName);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetCreateAt()).compareTo(other.isSetCreateAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetCreateAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.createAt, other.createAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetUpdateAt()).compareTo(other.isSetUpdateAt());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetUpdateAt()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.updateAt, other.updateAt);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetActive()).compareTo(other.isSetActive());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetActive()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.active, other.active);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
Exemplo n.º 5
0
  public boolean equals(TExerciseType that) {
    if (that == null) return false;

    boolean this_present_myid = true;
    boolean that_present_myid = true;
    if (this_present_myid || that_present_myid) {
      if (!(this_present_myid && that_present_myid)) return false;
      if (this.myid != that.myid) return false;
    }

    boolean this_present_typeName = true && this.isSetTypeName();
    boolean that_present_typeName = true && that.isSetTypeName();
    if (this_present_typeName || that_present_typeName) {
      if (!(this_present_typeName && that_present_typeName)) return false;
      if (!this.typeName.equals(that.typeName)) return false;
    }

    boolean this_present_createAt = true && this.isSetCreateAt();
    boolean that_present_createAt = true && that.isSetCreateAt();
    if (this_present_createAt || that_present_createAt) {
      if (!(this_present_createAt && that_present_createAt)) return false;
      if (!this.createAt.equals(that.createAt)) return false;
    }

    boolean this_present_updateAt = true && this.isSetUpdateAt();
    boolean that_present_updateAt = true && that.isSetUpdateAt();
    if (this_present_updateAt || that_present_updateAt) {
      if (!(this_present_updateAt && that_present_updateAt)) return false;
      if (!this.updateAt.equals(that.updateAt)) return false;
    }

    boolean this_present_active = true;
    boolean that_present_active = true;
    if (this_present_active || that_present_active) {
      if (!(this_present_active && that_present_active)) return false;
      if (this.active != that.active) return false;
    }

    return true;
  }
Exemplo n.º 6
0
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, TExerciseType struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetMyid()) {
     optionals.set(0);
   }
   if (struct.isSetTypeName()) {
     optionals.set(1);
   }
   if (struct.isSetCreateAt()) {
     optionals.set(2);
   }
   if (struct.isSetUpdateAt()) {
     optionals.set(3);
   }
   if (struct.isSetActive()) {
     optionals.set(4);
   }
   oprot.writeBitSet(optionals, 5);
   if (struct.isSetMyid()) {
     oprot.writeI32(struct.myid);
   }
   if (struct.isSetTypeName()) {
     oprot.writeString(struct.typeName);
   }
   if (struct.isSetCreateAt()) {
     oprot.writeString(struct.createAt);
   }
   if (struct.isSetUpdateAt()) {
     oprot.writeString(struct.updateAt);
   }
   if (struct.isSetActive()) {
     oprot.writeBool(struct.active);
   }
 }
Exemplo n.º 7
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();
    }