aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java3
-rw-r--r--framework/src/main/java/org/onap/cli/fw/input/ParameterType.java4
2 files changed, 6 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java
index 167b353d..31b83abb 100644
--- a/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java
+++ b/framework/src/main/java/org/onap/cli/fw/input/OnapCommandParameter.java
@@ -26,6 +26,7 @@ import org.onap.cli.fw.error.OnapCommandParameterMissing;
import java.io.File;
import java.util.List;
import java.util.Map;
+import java.util.UUID;
/**
* Onap Command's input parameter.
@@ -130,6 +131,8 @@ public class OnapCommandParameter {
} else if (this.getParameterType().equals(ParameterType.BOOL)) {
// For bool type always the default param is false
this.defaultValue = "false";
+ } else if (this.defaultValue.isEmpty() && this.getParameterType().equals(ParameterType.UUID)) {
+ this.defaultValue = UUID.randomUUID().toString();
}
return defaultValue;
diff --git a/framework/src/main/java/org/onap/cli/fw/input/ParameterType.java b/framework/src/main/java/org/onap/cli/fw/input/ParameterType.java
index ec76e0b4..c93d92fe 100644
--- a/framework/src/main/java/org/onap/cli/fw/input/ParameterType.java
+++ b/framework/src/main/java/org/onap/cli/fw/input/ParameterType.java
@@ -34,7 +34,7 @@ public enum ParameterType {
/**
* URL location.
*/
- URL, BOOL, ARRAY, MAP, BINARY;
+ URL, BOOL, ARRAY, MAP, BINARY, UUID;
/**
* Get parameter type.
@@ -64,6 +64,8 @@ public enum ParameterType {
return MAP;
} else if (BINARY.name().equalsIgnoreCase(name)) {
return BINARY;
+ } else if (UUID.name().equalsIgnoreCase(name)) {
+ return UUID;
} else {
throw new OnapCommandInvalidParameterType(name);
}