Make ListOption#toHex generic so that this works for any list option
So far this method was only working for ListChangesOption, now we can also use it for ListAccountsOption and ListGroupsOption. This allows to remove the toHex method from the code-owners plugin which needs this method for ListAccountsOption. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: I7f373e70b643c9db843e75875f75723f30f4b03c
This commit is contained in:
@@ -48,9 +48,9 @@ public interface ListOption {
|
||||
return r;
|
||||
}
|
||||
|
||||
static String toHex(Set<ListChangesOption> options) {
|
||||
static <T extends Enum<T> & ListOption> String toHex(Set<T> options) {
|
||||
int v = 0;
|
||||
for (ListChangesOption option : options) {
|
||||
for (T option : options) {
|
||||
v |= 1 << option.getValue();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user