re base code
[sdc.git] / catalog-model / src / main / java / org / openecomp / sdc / be / model / ComponentInstanceInput.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.be.model;
22
23 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
24 import org.openecomp.sdc.be.datatypes.elements.PropertyRule;
25
26 import java.util.List;
27
28 public class ComponentInstanceInput extends InputDefinition implements IComponentInstanceConnectedElement, IPropertyInputCommon {
29
30     /**
31      * The unique id of the property value on graph
32      */
33     private String valueUniqueUid;
34
35     private List<String> path = null;
36
37     private List<PropertyRule> rules = null;
38     private String componentInstanceName;
39     private String componentInstanceId;
40
41     public ComponentInstanceInput() {
42         super();
43     }
44
45     public ComponentInstanceInput(PropertyDataDefinition curPropertyDef, String inputId, String value,
46             String valueUniqueUid) {
47         super(curPropertyDef);
48         setInputId(inputId);
49         setValue(value);
50         this.valueUniqueUid = valueUniqueUid;
51     }
52
53     public ComponentInstanceInput(InputDefinition pd, String value, String valueUniqueUid) {
54         super(pd);
55
56         setValue(value);
57         this.valueUniqueUid = valueUniqueUid;
58     }
59
60     public ComponentInstanceInput(PropertyDataDefinition propertyDefinition) {
61         super(propertyDefinition);
62         if(propertyDefinition.getGetInputValues() != null && !propertyDefinition.getGetInputValues().isEmpty()){
63             setInputId(propertyDefinition.getGetInputValues().get(0).getInputId());
64         }
65     }
66
67     public String getComponentInstanceName() {
68         return componentInstanceName;
69     }
70
71     public void setComponentInstanceName(String componentInstanceName) {
72         this.componentInstanceName = componentInstanceName;
73     }
74
75     public String getComponentInstanceId() {
76         return componentInstanceId;
77     }
78
79     public void setComponentInstanceId(String componentInstanceId) {
80         this.componentInstanceId = componentInstanceId;
81     }
82
83     public String getValueUniqueUid() {
84         return valueUniqueUid;
85     }
86
87     public void setValueUniqueUid(String valueUniqueUid) {
88         this.valueUniqueUid = valueUniqueUid;
89     }
90
91     public List<String> getPath() {
92         return path;
93     }
94
95     public void setPath(List<String> path) {
96         this.path = path;
97     }
98
99     public List<PropertyRule> getRules() {
100         return rules;
101     }
102
103     public void setRules(List<PropertyRule> rules) {
104         this.rules = rules;
105     }
106
107     @Override
108     public String toString() {
109         return "ComponentInstanceInput [ " + super.toString() + " , value=" + getValue() + ", valueUniqueUid = "
110                 + valueUniqueUid + " , rules=" + rules + " , path=" + path + " ]";
111     }
112
113 }