diff options
Diffstat (limited to 'framework/src/main/java/org/onap')
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java | 4 | ||||
-rw-r--r-- | framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java index 74e488b4..167379d7 100644 --- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java +++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java @@ -1,5 +1,6 @@ /* * Copyright 2017 Huawei Technologies Co., Ltd. + * Copyright 2020 Nokia * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -125,7 +126,7 @@ public abstract class OnapCommand { } public void setParameters(Set<OnapCommandParameter> parameters) { - this.cmdParameters = parameters; + this.cmdParameters.addAll(parameters); } public Set<OnapCommandParameter> getParameters() { @@ -200,6 +201,7 @@ public abstract class OnapCommand { } public List<String> initializeSchema(OnapCommandSchemaInfo schema) throws OnapCommandException { + this.getInfo().setMetadata(schema.getMetadata()); return this.initializeSchema(schema.getSchemaName(), false); } diff --git a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java index aa45f58e..e051d5dd 100644 --- a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java +++ b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaLoader.java @@ -1,5 +1,6 @@ /* * Copyright 2017 Huawei Technologies Co., Ltd. + * Copyright 2020 Nokia * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,6 +27,7 @@ import static org.onap.cli.fw.conf.OnapCommandConstants.DIRECTION; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_AUTHOR; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_IGNORE; +import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_METADATA; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_PARAMS_LIST; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_PARAMS_MANDATORY_LIST; import static org.onap.cli.fw.conf.OnapCommandConstants.INFO_PRODUCT; @@ -262,6 +264,11 @@ public class OnapCommandSchemaLoader { info.setAuthor(mode.toString()); break; + case INFO_METADATA: + Object metadata = infoMap.get(key1); + info.setMetadata((Map<String,String>)metadata); + break; + case INFO_IGNORE: Object ignore = infoMap.get(key1); info.setIgnore(ignore.toString().equalsIgnoreCase(OnapCommandConstants.BOOLEAN_TRUE)); |