bc2513ea91e17761036feef6d4399f4b4db394cd
[vid.git] / vid-app-common / src / main / java / org / onap / vid / asdc / beans / tosca / InputProperties.java
1 package org.onap.vid.asdc.beans.tosca;
2
3 import org.onap.sdc.toscaparser.api.Property;
4
5 import java.util.List;
6
7 public class InputProperties {
8     private String sourceType;
9     private String vfModuleLabel;
10     private String paramName;
11
12     public InputProperties(){
13
14     }
15
16     public InputProperties(List<Property> properties) {
17         for(Property property: properties) {
18             if (property.getName().equals("source_type")) {
19                 this.sourceType = (String)property.getValue();
20                 continue;
21             } else if (property.getName().equals("param_name")) {
22                 this.paramName = (String)property.getValue();
23                 continue;
24             } else if (property.getName().equals("vf_module_label")) {
25                 this.vfModuleLabel = getPropertyValueAsString(property);
26                 continue;
27             }
28         }
29     }
30
31     public String getSourceType() {
32         return sourceType;
33     }
34
35     public void setSourceType(String sourceType) {
36         this.sourceType = sourceType;
37     }
38
39     public String getVfModuleLabel() {
40         return vfModuleLabel;
41     }
42
43     public void setVfModuleLabel(String vfModuleLabel) {
44         this.vfModuleLabel = vfModuleLabel;
45     }
46
47     public String getParamName() {
48         return paramName;
49     }
50
51     public void setParamName(String paramName) {
52         this.paramName = paramName;
53     }
54
55     private String getPropertyValueAsString(Property property) {
56         return property.getValue().toString().substring(1, property.getValue().toString().length()-1);
57     }
58
59
60
61
62
63 }