diff options
author | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-06 14:13:55 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@yahoo-inc.com> | 2017-06-06 14:13:55 +0200 |
commit | 8f2d9c36cccb34a1594d5f1cf82ac852ad5e712d (patch) | |
tree | 15addc0903bb361f6df8c5833877844d068687ab /vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java | |
parent | ef89ead652b55d7742767aea7e9c3d9243f19336 (diff) |
Move vespaclient-java to Vespa open-source
Diffstat (limited to 'vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java')
-rw-r--r-- | vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java b/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java new file mode 100644 index 00000000000..bba0d9803ed --- /dev/null +++ b/vespaclient-java/src/main/java/com/yahoo/vespastat/ClientParameters.java @@ -0,0 +1,73 @@ +// Copyright 2017 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespastat; + +/** + * This class contains the program parameters. + * + * @author bjorncs + */ +public class ClientParameters { + // Show help page if true + public final boolean help; + // Dump list of documents for all buckets matching the selection if true + public final boolean dumpData; + // The message bus route + public final String route; + // The selection type + public final SelectionType selectionType; + // The selection id + public final String id; + + public ClientParameters( + boolean help, + boolean dumpData, + String route, + SelectionType selectionType, + String id) { + this.help = help; + this.dumpData = dumpData; + this.route = route; + this.selectionType = selectionType; + this.id = id; + } + + public enum SelectionType {USER, GROUP, BUCKET, GID, DOCUMENT} + + public static class Builder { + private boolean help; + private boolean dumpData; + private String route; + private SelectionType selectionType; + private String id; + + public Builder setHelp(boolean help) { + this.help = help; + return this; + } + + public Builder setDumpData(boolean dumpData) { + this.dumpData = dumpData; + return this; + } + + public Builder setRoute(String route) { + this.route = route; + return this; + } + + public Builder setSelectionType(SelectionType selectionType) { + this.selectionType = selectionType; + return this; + } + + public Builder setId(String id) { + this.id = id; + return this; + } + + public ClientParameters build() { + return new ClientParameters(help, dumpData, route, selectionType, id); + } + } + +} |