@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_status = true && (isSetStatus()); list.add(present_status); if (present_status) list.add(status); boolean present_privilege = true && (isSetPrivilege()); list.add(present_privilege); if (present_privilege) list.add(privilege); boolean present_privileges = true && (isSetPrivileges()); list.add(present_privileges); if (present_privileges) list.add(privileges); return list.hashCode(); }
/** 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 PRIVILEGE: return isSetPrivilege(); case PRIVILEGES: return isSetPrivileges(); } throw new IllegalStateException(); }
if (isSetPrivileges()) { if (!first) sb.append(", "); sb.append("privileges:");
lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(other.isSetPrivileges()); if (lastComparison != 0) { return lastComparison; if (isSetPrivileges()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privileges, other.privileges); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleGrantPrivilegeResponse struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPrivilege()) { optionals.set(0); } if (struct.isSetPrivileges()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPrivilege()) { struct.privilege.write(oprot); } if (struct.isSetPrivileges()) { { oprot.writeI32(struct.privileges.size()); for (TSentryPrivilege _iter44 : struct.privileges) { _iter44.write(oprot); } } } }
/** * Performs a deep copy on <i>other</i>. */ public TAlterSentryRoleGrantPrivilegeResponse(TAlterSentryRoleGrantPrivilegeResponse other) { if (other.isSetStatus()) { this.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(other.status); } if (other.isSetPrivilege()) { this.privilege = new TSentryPrivilege(other.privilege); } if (other.isSetPrivileges()) { Set<TSentryPrivilege> __this__privileges = new HashSet<TSentryPrivilege>(other.privileges.size()); for (TSentryPrivilege other_element : other.privileges) { __this__privileges.add(new TSentryPrivilege(other_element)); } this.privileges = __this__privileges; } }
if (struct.isSetPrivileges()) { oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
public boolean equals(TAlterSentryRoleGrantPrivilegeResponse 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_privilege = true && this.isSetPrivilege(); boolean that_present_privilege = true && that.isSetPrivilege(); if (this_present_privilege || that_present_privilege) { if (!(this_present_privilege && that_present_privilege)) return false; if (!this.privilege.equals(that.privilege)) 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; }
response.setPrivileges(request.getPrivileges()); if (response.isSetPrivileges() && response.getPrivileges().size() == 1) { response.setPrivilege(response.getPrivileges().iterator().next());