I’m sure this is an easy one. I just want to dump the set after the for loop in to the array of type Role
This is what I got:
Role[] hotRoles;
Set <Role> roles = profile.getRoles(Section);
for (Role role : roles )
{
if( role.getName().contains("PART") && !role.getName().contains("READ_ONLY") )
{
System.out.println("Role: " + role.getName());
}
}
I want to put the vaues that come back from the for loop into hotPartRoles
thanks…….
I’m assuming that you only want the elements that are printed to go into the array?
You have to do this dynamically, since you don’t know in advance how many elements there will be.
Something like