aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/InputProperties.java
blob: bc2513ea91e17761036feef6d4399f4b4db394cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package org.onap.vid.asdc.beans.tosca;

import org.onap.sdc.toscaparser.api.Property;

import java.util.List;

public class InputProperties {
    private String sourceType;
    private String vfModuleLabel;
    private String paramName;

    public InputProperties(){

    }

    public InputProperties(List<Property> properties) {
        for(Property property: properties) {
            if (property.getName().equals("source_type")) {
                this.sourceType = (String)property.getValue();
                continue;
            } else if (property.getName().equals("param_name")) {
                this.paramName = (String)property.getValue();
                continue;
            } else if (property.getName().equals("vf_module_label")) {
                this.vfModuleLabel = getPropertyValueAsString(property);
                continue;
            }
        }
    }

    public String getSourceType() {
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

    public String getVfModuleLabel() {
        return vfModuleLabel;
    }

    public void setVfModuleLabel(String vfModuleLabel) {
        this.vfModuleLabel = vfModuleLabel;
    }

    public String getParamName() {
        return paramName;
    }

    public void setParamName(String paramName) {
        this.paramName = paramName;
    }

    private String getPropertyValueAsString(Property property) {
        return property.getValue().toString().substring(1, property.getValue().toString().length()-1);
    }





}