Extract a ListOption class, deduplicating fromBits method

Remove the toBits method, which was unused in all cases. It was
primarily for the GWT UI code.

Change-Id: I755c4b4a752ba9fe2a6771f313c4a9361d4c071b
This commit is contained in:
Dave Borowitz
2019-03-12 16:58:26 -07:00
parent f5d1e1c9c4
commit 0122e103c2
11 changed files with 138 additions and 91 deletions

View File

@@ -17,6 +17,7 @@ package com.google.gerrit.server.restapi.change;
import com.google.common.collect.Iterables;
import com.google.common.flogger.FluentLogger;
import com.google.gerrit.extensions.client.ListChangesOption;
import com.google.gerrit.extensions.client.ListOption;
import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.gerrit.extensions.restapi.AuthException;
import com.google.gerrit.extensions.restapi.BadRequestException;
@@ -70,7 +71,7 @@ public class QueryChanges implements RestReadView<TopLevelResource>, DynamicOpti
@Option(name = "-O", usage = "Output option flags, in hex")
void setOptionFlagsHex(String hex) {
options.addAll(ListChangesOption.fromBits(Integer.parseInt(hex, 16)));
options.addAll(ListOption.fromBits(ListChangesOption.class, Integer.parseInt(hex, 16)));
}
@Option(