Пример #1
0
 @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);
   }
 }
Пример #2
0
  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;
  }
Пример #3
0
  @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;
  }
Пример #4
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();
    }