I have an enum:
public enum ScopeItems {
BASIC_INFO, POLICY_INFO, USER_INFO
};
And I have a number of Auth objects which might hold any combination of these scopes.
What I want to do is assign an integer value depending on which of these scope items the Auth object holds.
So for example assume:
BASIC_INFO = 1; POLICY_INFO = 2; USER_INFO = 4;
If I have an integer value of 5 then I'd want to return an array with:
BASIC_INFO, USER_INFO
I also want it to work in reverse, so if I pass in an array of POLICY_INFO, USER_INFO I'd get 6 back.
I've got this working, but my solution seemed a bit too complicated for what it is. I'm sure there are better ways of going about it I'm not thinking of.