X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Ffcp%2Fquelaton%2FGetConfigCommandImpl.java;h=6e91c009966be0a47c7c2e866ddd84c966adbc0e;hb=dc9905f91a2c4d45acc0a7c90e87ed768ce6d3be;hp=dc4deb8359ad4564a2404afa3f02a2c10e995291;hpb=0cbff2edec655d3db4a1730c32483da952879494;p=jFCPlib.git diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/GetConfigCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/GetConfigCommandImpl.java index dc4deb8..6e91c00 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/GetConfigCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/GetConfigCommandImpl.java @@ -23,6 +23,7 @@ public class GetConfigCommandImpl implements GetConfigCommand { private final ListeningExecutorService threadPool; private final ConnectionSupplier connectionSupplier; private final AtomicBoolean withCurrent = new AtomicBoolean(); + private final AtomicBoolean withDefaults = new AtomicBoolean(); public GetConfigCommandImpl(ExecutorService threadPool, ConnectionSupplier connectionSupplier) { this.threadPool = MoreExecutors.listeningDecorator(threadPool); @@ -36,6 +37,12 @@ public class GetConfigCommandImpl implements GetConfigCommand { } @Override + public GetConfigCommand withDefaults() { + withDefaults.set(true); + return this; + } + + @Override public ListenableFuture execute() { return threadPool.submit(this::executeDialog); } @@ -43,6 +50,7 @@ public class GetConfigCommandImpl implements GetConfigCommand { private ConfigData executeDialog() throws IOException, ExecutionException, InterruptedException { GetConfig getConfig = new GetConfig(new RandomIdentifierGenerator().generate()); getConfig.setWithCurrent(withCurrent.get()); + getConfig.setWithDefaults(withDefaults.get()); try (GetConfigDialog getConfigDialog = new GetConfigDialog()) { return getConfigDialog.send(getConfig).get(); }