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; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ROLE_NAME: if (value == null) { unsetRoleName(); } else { setRoleName((String)value); } break; case GROUPS: if (value == null) { unsetGroups(); } else { setGroups((Set<TSentryGroup>)value); } break; case GRANTOR_PRINCIPAL: if (value == null) { unsetGrantorPrincipal(); } else { setGrantorPrincipal((String)value); } break; } }