[SDC] rebase 1710 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 java.util.List;
24
25 import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition;
26 import org.openecomp.sdc.be.datatypes.elements.PropertyRule;
27
28 public class ComponentInstanceInput extends InputDefinition implements IComponentInstanceConnectedElement, IPropertyInputCommon {
29
30         /**
31          * 
32          */
33         private static final long serialVersionUID = -3937554584759816724L;
34
35
36         /**
37          * The unique id of the property value on graph
38          */
39         private String valueUniqueUid;
40
41         private List<String> path = null;
42
43         private List<PropertyRule> rules = null;
44         private String componentInstanceName;
45         private String componentInstanceId;
46
47         public ComponentInstanceInput() {
48                 super();
49         }
50
51         public ComponentInstanceInput(PropertyDataDefinition curPropertyDef, String inputId, String value,
52                         String valueUniqueUid) {
53                 super(curPropertyDef);
54                 setInputId(inputId);
55                 setValue(value);
56                 this.valueUniqueUid = valueUniqueUid;
57         }
58
59         public ComponentInstanceInput(InputDefinition pd, String value, String valueUniqueUid) {
60                 super(pd);
61
62                 setValue(value);
63                 this.valueUniqueUid = valueUniqueUid;
64         }
65
66         public ComponentInstanceInput(PropertyDataDefinition propertyDefinition) {
67                 super(propertyDefinition);
68                 if(propertyDefinition.getGetInputValues() != null && !propertyDefinition.getGetInputValues().isEmpty()){
69                         setInputId(propertyDefinition.getGetInputValues().get(0).getInputId());
70                 }
71         }
72
73         public String getComponentInstanceName() {
74                 return componentInstanceName;
75         }
76
77         public void setComponentInstanceName(String componentInstanceName) {
78                 this.componentInstanceName = componentInstanceName;
79         }
80
81         public String getComponentInstanceId() {
82                 return componentInstanceId;
83         }
84
85         public void setComponentInstanceId(String componentInstanceId) {
86                 this.componentInstanceId = componentInstanceId;
87         }
88
89         public String getValueUniqueUid() {
90                 return valueUniqueUid;
91         }
92
93         public void setValueUniqueUid(String valueUniqueUid) {
94                 this.valueUniqueUid = valueUniqueUid;
95         }
96
97         /*public boolean isDefinition() {
98                 return definition;
99         }
100
101         public void setDefinition(boolean definition) {
102                 this.definition = definition;
103         }*/
104
105         public List<String> getPath() {
106                 return path;
107         }
108
109         public void setPath(List<String> path) {
110                 this.path = path;
111         }
112
113         public List<PropertyRule> getRules() {
114                 return rules;
115         }
116
117         public void setRules(List<PropertyRule> rules) {
118                 this.rules = rules;
119         }
120
121         @Override
122         public String toString() {
123                 return "ComponentInstanceInput [ " + super.toString() + " , value=" + getValue() + ", valueUniqueUid = "
124                                 + valueUniqueUid + " , rules=" + rules + " , path=" + path + " ]";
125         }
126
127 }