@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_privilegesMapByAuth = true && (isSetPrivilegesMapByAuth()); list.add(present_privilegesMapByAuth); if (present_privilegesMapByAuth) list.add(privilegesMapByAuth); 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 PRIVILEGES_MAP_BY_AUTH: return isSetPrivilegesMapByAuth(); } throw new IllegalStateException(); }
@Override public String toString() { StringBuilder sb = new StringBuilder("TListSentryPrivilegesByAuthResponse("); boolean first = true; sb.append("status:"); if (this.status == null) { sb.append("null"); } else { sb.append(this.status); } first = false; if (isSetPrivilegesMapByAuth()) { if (!first) sb.append(", "); sb.append("privilegesMapByAuth:"); if (this.privilegesMapByAuth == null) { sb.append("null"); } else { sb.append(this.privilegesMapByAuth); } first = false; } sb.append(")"); return sb.toString(); }
@Override public int compareTo(TListSentryPrivilegesByAuthResponse other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetStatus()).compareTo(other.isSetStatus()); if (lastComparison != 0) { return lastComparison; } if (isSetStatus()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.status, other.status); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPrivilegesMapByAuth()).compareTo(other.isSetPrivilegesMapByAuth()); if (lastComparison != 0) { return lastComparison; } if (isSetPrivilegesMapByAuth()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privilegesMapByAuth, other.privilegesMapByAuth); if (lastComparison != 0) { return lastComparison; } } return 0; }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryPrivilegesByAuthResponse(TListSentryPrivilegesByAuthResponse other) { if (other.isSetStatus()) { this.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(other.status); } if (other.isSetPrivilegesMapByAuth()) { Map<String,TSentryPrivilegeMap> __this__privilegesMapByAuth = new HashMap<String,TSentryPrivilegeMap>(other.privilegesMapByAuth.size()); for (Map.Entry<String, TSentryPrivilegeMap> other_element : other.privilegesMapByAuth.entrySet()) { String other_element_key = other_element.getKey(); TSentryPrivilegeMap other_element_value = other_element.getValue(); String __this__privilegesMapByAuth_copy_key = other_element_key; TSentryPrivilegeMap __this__privilegesMapByAuth_copy_value = new TSentryPrivilegeMap(other_element_value); __this__privilegesMapByAuth.put(__this__privilegesMapByAuth_copy_key, __this__privilegesMapByAuth_copy_value); } this.privilegesMapByAuth = __this__privilegesMapByAuth; } }
public boolean equals(TListSentryPrivilegesByAuthResponse 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_privilegesMapByAuth = true && this.isSetPrivilegesMapByAuth(); boolean that_present_privilegesMapByAuth = true && that.isSetPrivilegesMapByAuth(); if (this_present_privilegesMapByAuth || that_present_privilegesMapByAuth) { if (!(this_present_privilegesMapByAuth && that_present_privilegesMapByAuth)) return false; if (!this.privilegesMapByAuth.equals(that.privilegesMapByAuth)) return false; } return true; }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TListSentryPrivilegesByAuthResponse struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; struct.status.write(oprot); BitSet optionals = new BitSet(); if (struct.isSetPrivilegesMapByAuth()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetPrivilegesMapByAuth()) { { oprot.writeI32(struct.privilegesMapByAuth.size()); for (Map.Entry<String, TSentryPrivilegeMap> _iter143 : struct.privilegesMapByAuth.entrySet()) { oprot.writeString(_iter143.getKey()); _iter143.getValue().write(oprot); } } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TListSentryPrivilegesByAuthResponse 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.privilegesMapByAuth != null) { if (struct.isSetPrivilegesMapByAuth()) { oprot.writeFieldBegin(PRIVILEGES_MAP_BY_AUTH_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.privilegesMapByAuth.size())); for (Map.Entry<String, TSentryPrivilegeMap> _iter142 : struct.privilegesMapByAuth.entrySet()) { oprot.writeString(_iter142.getKey()); _iter142.getValue().write(oprot); } oprot.writeMapEnd(); } oprot.writeFieldEnd(); } } oprot.writeFieldStop(); oprot.writeStructEnd(); }