/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case STATUS: return isSetStatus(); case PRIVILEGES: return isSetPrivileges(); } throw new IllegalStateException(); }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_status = true && (isSetStatus()); builder.append(present_status); if (present_status) builder.append(status); boolean present_privileges = true && (isSetPrivileges()); builder.append(present_privileges); if (present_privileges) builder.append(privileges); return builder.toHashCode(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("TListSentryPrivilegesResponse("); boolean first = true; sb.append("status:"); if (this.status == null) { sb.append("null"); } else { sb.append(this.status); } first = false; if (isSetPrivileges()) { if (!first) sb.append(", "); sb.append("privileges:"); if (this.privileges == null) { sb.append("null"); } else { sb.append(this.privileges); } first = false; } sb.append(")"); return sb.toString(); }
public int compareTo(TListSentryPrivilegesResponse other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; TListSentryPrivilegesResponse typedOther = (TListSentryPrivilegesResponse)other; lastComparison = Boolean.valueOf(isSetStatus()).compareTo(typedOther.isSetStatus()); if (lastComparison != 0) { return lastComparison; } if (isSetStatus()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, typedOther.status); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(typedOther.isSetPrivileges()); if (lastComparison != 0) { return lastComparison; } if (isSetPrivileges()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privileges, typedOther.privileges); if (lastComparison != 0) { return lastComparison; } } return 0; }
public boolean equals(TListSentryPrivilegesResponse that) { if (that == null) return false; boolean this_present_status = true && this.isSetStatus(); boolean that_present_status = true && that.isSetStatus(); if (this_present_status || that_present_status) { if (!(this_present_status && that_present_status)) return false; if (!this.status.equals(that.status)) return false; } boolean this_present_privileges = true && this.isSetPrivileges(); boolean that_present_privileges = true && that.isSetPrivileges(); if (this_present_privileges || that_present_privileges) { if (!(this_present_privileges && that_present_privileges)) return false; if (!this.privileges.equals(that.privileges)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesResponse struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPrivileges()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPrivileges()) { { oprot.writeI32(struct.privileges.size()); for (TSentryPrivilege _iter60 : struct.privileges) { _iter60.write(oprot); } } } }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryPrivilegesResponse(TListSentryPrivilegesResponse other) { if (other.isSetStatus()) { this.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(other.status); } if (other.isSetPrivileges()) { Set<TSentryPrivilege> __this__privileges = new HashSet<TSentryPrivilege>(); for (TSentryPrivilege other_element : other.privileges) { __this__privileges.add(new TSentryPrivilege(other_element)); } this.privileges = __this__privileges; } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TListSentryPrivilegesResponse struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); struct.status.write(oprot); oprot.writeFieldEnd(); } if (struct.privileges != null) { if (struct.isSetPrivileges()) { oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC); { oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, struct.privileges.size())); for (TSentryPrivilege _iter59 : struct.privileges) { _iter59.write(oprot); } oprot.writeSetEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }