public TSentryRole deepCopy() { return new TSentryRole(this); }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryRolesResponse(TListSentryRolesResponse other) { if (other.isSetStatus()) { this.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(other.status); } if (other.isSetRoles()) { Set<TSentryRole> __this__roles = new HashSet<TSentryRole>(); for (TSentryRole other_element : other.roles) { __this__roles.add(new TSentryRole(other_element)); } this.roles = __this__roles; } }
private TSentryRole convertToTSentryRole(MSentryRole mSentryRole) { TSentryRole role = new TSentryRole(); role.setRoleName(mSentryRole.getRoleName()); role.setGrantorPrincipal("--"); Set<TSentryGroup> sentryGroups = new HashSet<TSentryGroup>(); for(MSentryGroup mSentryGroup:mSentryRole.getGroups()) { TSentryGroup group = convertToTSentryGroup(mSentryGroup); sentryGroups.add(group); } role.setGroups(sentryGroups); return role; }
_elem50 = new TSentryRole(); _elem50.read(iprot); struct.roles.add(_elem50);
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TListSentryRolesResponse struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.status = new org.apache.sentry.service.thrift.TSentryResponseStatus(); struct.status.read(iprot); struct.setStatusIsSet(true); BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { org.apache.thrift.protocol.TSet _set53 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); struct.roles = new HashSet<TSentryRole>(2*_set53.size); for (int _i54 = 0; _i54 < _set53.size; ++_i54) { TSentryRole _elem55; // required _elem55 = new TSentryRole(); _elem55.read(iprot); struct.roles.add(_elem55); } } struct.setRolesIsSet(true); } } }