zhiru 6 년 전
부모
커밋
229be66c8c
1개의 변경된 파일50개의 추가작업 그리고 0개의 파일을 삭제
  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 +
+                '}';
+    }
+}