--- /dev/null
+/**\r
+ * Copyright (c) 2017 ZTE Corporation.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * and the Apache License 2.0 which both accompany this distribution,\r
+ * and are available at http://www.eclipse.org/legal/epl-v10.html\r
+ * and http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Contributors:\r
+ * ZTE - initial API and implementation and/or initial documentation\r
+ */\r
+package org.onap.sdc.workflowdesigner.model;\r
+\r
+import org.slf4j.Logger;\r
+import org.slf4j.LoggerFactory;\r
+\r
+import com.fasterxml.jackson.annotation.JsonInclude;\r
+import com.fasterxml.jackson.annotation.JsonInclude.Include;\r
+import com.fasterxml.jackson.core.JsonProcessingException;\r
+import com.fasterxml.jackson.databind.ObjectMapper;\r
+\r
+public class Parameter {\r
+ private static Logger log = LoggerFactory.getLogger(Parameter.class);\r
+ private String description = "";\r
+ private String name;\r
+ private String position;\r
+ private boolean required;\r
+ private String type;\r
+\r
+ // body parameter may be a json object\r
+ private Object value;\r
+\r
+ @JsonInclude(Include.NON_NULL)\r
+ private String valueSource;\r
+\r
+ public String getDescription() {\r
+ return description;\r
+ }\r
+\r
+ public void setDescription(String description) {\r
+ this.description = description;\r
+ }\r
+\r
+ public String getName() {\r
+ return name;\r
+ }\r
+\r
+ public void setName(String name) {\r
+ this.name = name;\r
+ }\r
+\r
+ public String getPosition() {\r
+ return position;\r
+ }\r
+\r
+ public void setPosition(String position) {\r
+ this.position = position;\r
+ }\r
+\r
+ public boolean isRequired() {\r
+ return required;\r
+ }\r
+\r
+ public void setRequired(boolean required) {\r
+ this.required = required;\r
+ }\r
+\r
+ public String getType() {\r
+ return type;\r
+ }\r
+\r
+ public void setType(String type) {\r
+ this.type = type;\r
+ }\r
+\r
+ public Object getValue() {\r
+ return value;\r
+ }\r
+\r
+ public void setValue(Object value) {\r
+ this.value = value;\r
+ }\r
+\r
+ public String getValueSource() {\r
+ return valueSource;\r
+ }\r
+\r
+ public void setValueSource(String valueSource) {\r
+ this.valueSource = valueSource;\r
+ }\r
+\r
+ public String toString() {\r
+ ObjectMapper mapper = new ObjectMapper();\r
+ String result = null;\r
+ try {\r
+ result = mapper.writeValueAsString(this);\r
+ } catch (JsonProcessingException e) {\r
+ log.error("fail to convert parameter to json string", e);\r
+ }\r
+ return result;\r
+ }\r
+\r
+}\r