@Override public void write(org.apache.thrift.protocol.TProtocol prot, TCredentials struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetPrincipal()) { optionals.set(0); } if (struct.isSetTokenClassName()) { optionals.set(1); } if (struct.isSetToken()) { optionals.set(2); } if (struct.isSetInstanceId()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetPrincipal()) { oprot.writeString(struct.principal); } if (struct.isSetTokenClassName()) { oprot.writeString(struct.tokenClassName); } if (struct.isSetToken()) { oprot.writeBinary(struct.token); } if (struct.isSetInstanceId()) { oprot.writeString(struct.instanceId); } }
public boolean equals(TCredentials that) { if (that == null) return false; boolean this_present_principal = true && this.isSetPrincipal(); boolean that_present_principal = true && that.isSetPrincipal(); if (this_present_principal || that_present_principal) { if (!(this_present_principal && that_present_principal)) return false; if (!this.principal.equals(that.principal)) return false; } boolean this_present_tokenClassName = true && this.isSetTokenClassName(); boolean that_present_tokenClassName = true && that.isSetTokenClassName(); if (this_present_tokenClassName || that_present_tokenClassName) { if (!(this_present_tokenClassName && that_present_tokenClassName)) return false; if (!this.tokenClassName.equals(that.tokenClassName)) return false; } boolean this_present_token = true && this.isSetToken(); boolean that_present_token = true && that.isSetToken(); if (this_present_token || that_present_token) { if (!(this_present_token && that_present_token)) return false; if (!this.token.equals(that.token)) return false; } boolean this_present_instanceId = true && this.isSetInstanceId(); boolean that_present_instanceId = true && that.isSetInstanceId(); if (this_present_instanceId || that_present_instanceId) { if (!(this_present_instanceId && that_present_instanceId)) return false; if (!this.instanceId.equals(that.instanceId)) return false; } return true; }
@Override public int compareTo(TCredentials other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetPrincipal()).compareTo(other.isSetPrincipal()); if (lastComparison != 0) { return lastComparison; } if (isSetPrincipal()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.principal, other.principal); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTokenClassName()).compareTo(other.isSetTokenClassName()); if (lastComparison != 0) { return lastComparison; } if (isSetTokenClassName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tokenClassName, other.tokenClassName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetToken()).compareTo(other.isSetToken()); if (lastComparison != 0) { return lastComparison; } if (isSetToken()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, other.token); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetInstanceId()).compareTo(other.isSetInstanceId()); if (lastComparison != 0) { return lastComparison; } if (isSetInstanceId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.instanceId, other.instanceId); if (lastComparison != 0) { return lastComparison; } } return 0; }
/** Performs a deep copy on <i>other</i>. */ public TCredentials(TCredentials other) { if (other.isSetPrincipal()) { this.principal = other.principal; } if (other.isSetTokenClassName()) { this.tokenClassName = other.tokenClassName; } if (other.isSetToken()) { this.token = org.apache.thrift.TBaseHelper.copyBinary(other.token); } if (other.isSetInstanceId()) { this.instanceId = other.instanceId; } }