public boolean equals(SetStateTOptions that) {
    if (that == null) return false;

    boolean this_present_pinned = true && this.isSetPinned();
    boolean that_present_pinned = true && that.isSetPinned();
    if (this_present_pinned || that_present_pinned) {
      if (!(this_present_pinned && that_present_pinned)) return false;
      if (this.pinned != that.pinned) return false;
    }

    boolean this_present_ttl = true && this.isSetTtl();
    boolean that_present_ttl = true && that.isSetTtl();
    if (this_present_ttl || that_present_ttl) {
      if (!(this_present_ttl && that_present_ttl)) return false;
      if (this.ttl != that.ttl) return false;
    }

    boolean this_present_persisted = true && this.isSetPersisted();
    boolean that_present_persisted = true && that.isSetPersisted();
    if (this_present_persisted || that_present_persisted) {
      if (!(this_present_persisted && that_present_persisted)) return false;
      if (this.persisted != that.persisted) return false;
    }

    return true;
  }
 @Override
 public void write(org.apache.thrift.protocol.TProtocol prot, SetStateTOptions struct)
     throws org.apache.thrift.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetPinned()) {
     optionals.set(0);
   }
   if (struct.isSetTtl()) {
     optionals.set(1);
   }
   if (struct.isSetPersisted()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetPinned()) {
     oprot.writeBool(struct.pinned);
   }
   if (struct.isSetTtl()) {
     oprot.writeI64(struct.ttl);
   }
   if (struct.isSetPersisted()) {
     oprot.writeBool(struct.persisted);
   }
 }
  @Override
  public int compareTo(SetStateTOptions other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetPinned()).compareTo(other.isSetPinned());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPinned()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pinned, other.pinned);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetTtl()).compareTo(other.isSetTtl());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetTtl()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ttl, other.ttl);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetPersisted()).compareTo(other.isSetPersisted());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetPersisted()) {
      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.persisted, other.persisted);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }
    public void write(org.apache.thrift.protocol.TProtocol oprot, SetStateTOptions struct)
        throws org.apache.thrift.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.isSetPinned()) {
        oprot.writeFieldBegin(PINNED_FIELD_DESC);
        oprot.writeBool(struct.pinned);
        oprot.writeFieldEnd();
      }
      if (struct.isSetTtl()) {
        oprot.writeFieldBegin(TTL_FIELD_DESC);
        oprot.writeI64(struct.ttl);
        oprot.writeFieldEnd();
      }
      if (struct.isSetPersisted()) {
        oprot.writeFieldBegin(PERSISTED_FIELD_DESC);
        oprot.writeBool(struct.persisted);
        oprot.writeFieldEnd();
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    public void read(org.apache.thrift.protocol.TProtocol iprot, SetStateTOptions 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: // PINNED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.pinned = iprot.readBool();
              struct.setPinnedIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 2: // TTL
            if (schemeField.type == org.apache.thrift.protocol.TType.I64) {
              struct.ttl = iprot.readI64();
              struct.setTtlIsSet(true);
            } else {
              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
            }
            break;
          case 3: // PERSISTED
            if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
              struct.persisted = iprot.readBool();
              struct.setPersistedIsSet(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();
    }
 @Override
 public void read(org.apache.thrift.protocol.TProtocol prot, SetStateTOptions struct)
     throws org.apache.thrift.TException {
   TTupleProtocol iprot = (TTupleProtocol) prot;
   BitSet incoming = iprot.readBitSet(3);
   if (incoming.get(0)) {
     struct.pinned = iprot.readBool();
     struct.setPinnedIsSet(true);
   }
   if (incoming.get(1)) {
     struct.ttl = iprot.readI64();
     struct.setTtlIsSet(true);
   }
   if (incoming.get(2)) {
     struct.persisted = iprot.readBool();
     struct.setPersistedIsSet(true);
   }
 }