Merge from ECOMP's repository
[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             } else if (property.getName().equals("param_name")) {
21                 this.paramName = (String)property.getValue();
22             } else if (property.getName().equals("vf_module_label")) {
23                 this.vfModuleLabel = getPropertyValueAsString(property);
24             }
25         }
26     }
27
28     public String getSourceType() {
29         return sourceType;
30     }
31
32     public void setSourceType(String sourceType) {
33         this.sourceType = sourceType;
34     }
35
36     public String getVfModuleLabel() {
37         return vfModuleLabel;
38     }
39
40     public void setVfModuleLabel(String vfModuleLabel) {
41         this.vfModuleLabel = vfModuleLabel;
42     }
43
44     public String getParamName() {
45         return paramName;
46     }
47
48     public void setParamName(String paramName) {
49         this.paramName = paramName;
50     }
51
52     private String getPropertyValueAsString(Property property) {
53         return property.getValue().toString().substring(1, property.getValue().toString().length()-1);
54     }
55
56
57
58
59
60 }