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