public static final String IS_OPTIONAL = "is_optional";
public static final String DEFAULT_VALUE = "default_value";
public static final String IS_SECURED = "is_secured";
+ public static final String IS_INCLUDE = "is_include";
public static final String DIRECTION = "direction";
public static final String ATTRIBUTES = "attributes";
/*
* raw value, get stored as its without processing it.
+ * it will have same value as stored in yaml template
*/
private Object rawValue = null;
+ /*
+ * to support include concepts of templates, new variable
+ * called is_include is introduced and default its always
+ * true.
+ */
+ private boolean isInclude = true;
+
public String getName() {
return cmdName;
}
this.isSecured = isSecured;
}
+ public boolean isInclude() {
+ return isInclude;
+ }
+
+ public void setInclude(boolean isInclude) {
+ this.isInclude = isInclude;
+ }
+
public static String printShortOption(String option) {
return "-" + option;
}
import static org.onap.cli.fw.conf.Constants.INPUT_PARAMS_MANDATORY_LIST;
import static org.onap.cli.fw.conf.Constants.IS_OPTIONAL;
import static org.onap.cli.fw.conf.Constants.IS_SECURED;
+import static org.onap.cli.fw.conf.Constants.IS_INCLUDE;
import static org.onap.cli.fw.conf.Constants.LONG_OPTION;
import static org.onap.cli.fw.conf.Constants.METHOD;
import static org.onap.cli.fw.conf.Constants.METHOD_TYPE;
param.setSecured(false);
}
break;
+
+ case IS_INCLUDE:
+ if (validate) {
+ if (!validateBoolean(String.valueOf(parameter.get(key2)))) {
+ exceptionList.add(invalidBooleanValueMessage(parameter.get(NAME),
+ IS_INCLUDE, parameter.get(key2)));
+ }
+ }
+
+ if ("true".equalsIgnoreCase(String.valueOf(parameter.get(key2)))) {
+ param.setInclude(true);
+ } else {
+ param.setInclude(false);
+ }
+ break;
}
}
long_option: bool
is_optional: true
default_value: false
+ is_include: true
- name: secure-param
type: string
description: Onap secure param such as password