Пример #1
0
 @Override
 public void write(libthrift091.protocol.TProtocol prot, Credential struct)
     throws libthrift091.TException {
   TTupleProtocol oprot = (TTupleProtocol) prot;
   BitSet optionals = new BitSet();
   if (struct.isSetType()) {
     optionals.set(0);
   }
   if (struct.isSetSecretKeyId()) {
     optionals.set(1);
   }
   if (struct.isSetSecretKey()) {
     optionals.set(2);
   }
   oprot.writeBitSet(optionals, 3);
   if (struct.isSetType()) {
     oprot.writeI32(struct.type.getValue());
   }
   if (struct.isSetSecretKeyId()) {
     oprot.writeString(struct.secretKeyId);
   }
   if (struct.isSetSecretKey()) {
     oprot.writeString(struct.secretKey);
   }
 }
Пример #2
0
    public void write(libthrift091.protocol.TProtocol oprot, Credential struct)
        throws libthrift091.TException {
      struct.validate();

      oprot.writeStructBegin(STRUCT_DESC);
      if (struct.type != null) {
        if (struct.isSetType()) {
          oprot.writeFieldBegin(TYPE_FIELD_DESC);
          oprot.writeI32(struct.type.getValue());
          oprot.writeFieldEnd();
        }
      }
      if (struct.secretKeyId != null) {
        if (struct.isSetSecretKeyId()) {
          oprot.writeFieldBegin(SECRET_KEY_ID_FIELD_DESC);
          oprot.writeString(struct.secretKeyId);
          oprot.writeFieldEnd();
        }
      }
      if (struct.secretKey != null) {
        if (struct.isSetSecretKey()) {
          oprot.writeFieldBegin(SECRET_KEY_FIELD_DESC);
          oprot.writeString(struct.secretKey);
          oprot.writeFieldEnd();
        }
      }
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
Пример #3
0
  public boolean equals(Credential that) {
    if (that == null) return false;

    boolean this_present_type = true && this.isSetType();
    boolean that_present_type = true && that.isSetType();
    if (this_present_type || that_present_type) {
      if (!(this_present_type && that_present_type)) return false;
      if (!this.type.equals(that.type)) return false;
    }

    boolean this_present_secretKeyId = true && this.isSetSecretKeyId();
    boolean that_present_secretKeyId = true && that.isSetSecretKeyId();
    if (this_present_secretKeyId || that_present_secretKeyId) {
      if (!(this_present_secretKeyId && that_present_secretKeyId)) return false;
      if (!this.secretKeyId.equals(that.secretKeyId)) return false;
    }

    boolean this_present_secretKey = true && this.isSetSecretKey();
    boolean that_present_secretKey = true && that.isSetSecretKey();
    if (this_present_secretKey || that_present_secretKey) {
      if (!(this_present_secretKey && that_present_secretKey)) return false;
      if (!this.secretKey.equals(that.secretKey)) return false;
    }

    return true;
  }
Пример #4
0
 /** Performs a deep copy on <i>other</i>. */
 public Credential(Credential other) {
   if (other.isSetType()) {
     this.type = other.type;
   }
   if (other.isSetSecretKeyId()) {
     this.secretKeyId = other.secretKeyId;
   }
   if (other.isSetSecretKey()) {
     this.secretKey = other.secretKey;
   }
 }
Пример #5
0
  @Override
  public int compareTo(Credential other) {
    if (!getClass().equals(other.getClass())) {
      return getClass().getName().compareTo(other.getClass().getName());
    }

    int lastComparison = 0;

    lastComparison = Boolean.valueOf(isSetType()).compareTo(other.isSetType());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetType()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.type, other.type);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecretKeyId()).compareTo(other.isSetSecretKeyId());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecretKeyId()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.secretKeyId, other.secretKeyId);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    lastComparison = Boolean.valueOf(isSetSecretKey()).compareTo(other.isSetSecretKey());
    if (lastComparison != 0) {
      return lastComparison;
    }
    if (isSetSecretKey()) {
      lastComparison = libthrift091.TBaseHelper.compareTo(this.secretKey, other.secretKey);
      if (lastComparison != 0) {
        return lastComparison;
      }
    }
    return 0;
  }