zhiru 5 år sedan
förälder
incheckning
229be66c8c
1 ändrade filer med 50 tillägg och 0 borttagningar
  1. 50 0
      src/main/java/io/milvus/client/CommandParam.java

+ 50 - 0
src/main/java/io/milvus/client/CommandParam.java

@@ -0,0 +1,50 @@
+package io.milvus.client;
+
+import javax.annotation.Nonnull;
+
+public class CommandParam {
+    private final String command;
+    private final long timeout;
+
+    public static class Builder {
+        // Required parameters
+        private final String command;
+
+        // Optional parameters - initialized to default values
+        private long timeout = 10;
+
+        public Builder(String command) {
+            this.command = command;
+        }
+
+        public Builder withTimeout(long timeout) {
+            this.timeout = timeout;
+            return this;
+        }
+
+        public CommandParam build() {
+            return new CommandParam(this);
+        }
+    }
+
+    private CommandParam(@Nonnull Builder builder) {
+        this.command = builder.command;
+        this.timeout = builder.timeout;
+    }
+
+    public String getCommand() {
+        return command;
+    }
+
+    public long getTimeout() {
+        return timeout;
+    }
+
+    @Override
+    public String toString() {
+        return "CommandParam {" +
+                "command='" + command + '\'' +
+                ", timeout=" + timeout +
+                '}';
+    }
+}