From df993e4e7a2b5af0c8e0907a80e1a4cef10ee56d Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Thu, 11 Feb 2016 14:17:18 +0000
Subject: [PATCH] OPENDJSDK-42 cli arguments fluent builder

---
 opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java |   32 +++++++++++++++++---------------
 1 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java b/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
index a1cbc9f..8827ba2 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/tools/JavaPropertiesToolArgumentParser.java
@@ -22,7 +22,7 @@
  *
  *
  *      Copyright 2007-2010 Sun Microsystems, Inc.
- *      Portions Copyright 2014-2015 ForgeRock AS
+ *      Portions Copyright 2014-2016 ForgeRock AS
  */
 package org.opends.server.tools;
 
@@ -84,22 +84,24 @@
     quietArg = CommonArguments.getQuiet();
     addArgument(quietArg);
 
-    propertiesFileArg = new StringArgument("propertiesFile",
-        'p', "propertiesFile", false,
-        false, true, INFO_PATH_PLACEHOLDER.get(), getDefaultPropertiesValue(),
-        "propertiesFile",
-        INFO_JAVAPROPERTIES_DESCRIPTION_PROPERTIES_FILE.get(
-            getDefaultPropertiesValue()));
-    propertiesFileArg.setHidden(true);
+    propertiesFileArg =
+            StringArgument.builder("propertiesFile")
+                    .shortIdentifier('p')
+                    .description(INFO_JAVAPROPERTIES_DESCRIPTION_PROPERTIES_FILE.get(getDefaultPropertiesValue()))
+                    .hidden()
+                    .defaultValue(getDefaultPropertiesValue())
+                    .valuePlaceholder(INFO_PATH_PLACEHOLDER.get())
+                    .buildArgument();
     addArgument(propertiesFileArg);
 
-    destinationFileArg = new StringArgument("destinationFile",
-        'd', "destinationFile", false,
-        false, true, INFO_PATH_PLACEHOLDER.get(), getDefaultDestinationValue(),
-        "destinationFile",
-        INFO_JAVAPROPERTIES_DESCRIPTION_DESTINATION_FILE.get(
-            getDefaultDestinationValue()));
-    destinationFileArg.setHidden(true);
+    destinationFileArg =
+            StringArgument.builder("destinationFile")
+                    .shortIdentifier('d')
+                    .description(INFO_JAVAPROPERTIES_DESCRIPTION_DESTINATION_FILE.get(getDefaultDestinationValue()))
+                    .hidden()
+                    .defaultValue(getDefaultDestinationValue())
+                    .valuePlaceholder(INFO_PATH_PLACEHOLDER.get())
+                    .buildArgument();
     addArgument(destinationFileArg);
 
     showUsageArg = CommonArguments.getShowUsage();

--
Gitblit v1.10.0