Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / asdc / beans / tosca / Input.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
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.onap.vid.asdc.beans.tosca;
22
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import org.onap.sdc.toscaparser.api.Property;
25
26 import java.util.ArrayList;
27 import java.util.List;
28
29 // TODO: Auto-generated Javadoc
30 /**
31  * The Class Input.
32  */
33 public class Input {
34
35         public Input(org.onap.sdc.toscaparser.api.parameters.Input input, List<Property> properties){
36                 this.type = input.getType();
37                 this.description = input.getDescription();
38                 this._default = input.getDefault();
39                 this.inputProperties = new InputProperties(properties);
40                 this.fromInputName = input.getName();
41         }
42
43         /** The type. */
44         private String type;
45         
46         /** The description. */
47         private String description;
48         
49         /** The default. */
50         private Object _default;
51         
52         /** The entry schema. */
53         private Input entry_schema;
54
55         private InputProperties inputProperties;
56
57         private String fromInputName;
58
59         /** The constraints */
60         private List<org.onap.sdc.toscaparser.api.elements.constraints.Constraint> constraints;
61         
62         /** The required field. If not set, the default is true */
63         private boolean required = true;
64         
65         /** Details the inputs template */
66         private String templateName;
67         private String templateUUID;
68         private String templateInvariantUUID;
69         private String templateCustomizationUUID;
70
71         /**
72          * Instantiates a new input.
73          */
74         public Input() {
75                 constraints = new ArrayList<>();
76         }
77         
78         /**
79          * Gets the type.
80          *
81          * @return the type
82          */
83         public String getType() {
84                 return type;
85         }
86         
87         /**
88          * Sets the type.
89          *
90          * @param type the new type
91          */
92         public void setType(String type) {
93                 this.type = type;
94         }
95         /**
96          * Gets the required field.
97          *
98          * @return the required field
99          */
100         public boolean getRequired() {
101                 return required;
102         }
103         /**
104          * Sets the required value.
105          *
106          * @param required the new required value
107          */
108         public void setRequired(boolean required) {
109                 this.required = required;
110         }
111         /**
112          * Gets the description.
113          *
114          * @return the description
115          */
116         public String getDescription() {
117                 return description;
118         }
119         
120         /**
121          * Sets the description.
122          *
123          * @param description the new description
124          */
125         public void setDescription(String description) {
126                 this.description = description;
127         }
128         
129         /**
130          * Gets the default.
131          *
132          * @return the default
133          */
134         public Object getDefault() {
135                 return _default;
136         }
137         
138         /**
139          * Sets the default.
140          *
141          * @param _default the new default
142          */
143         public void setDefault(Object _default) {
144                 this._default = _default;
145         }
146         
147         /**
148          * Gets the entry schema.
149          *
150          * @return the entry schema
151          */
152         public Input getentry_schema() {
153                 return entry_schema;
154         }
155         /**
156          * Sets the entry schema.
157          *
158          */
159         public void setentry_schema(Input s) {
160                 this.entry_schema = s;
161         }
162
163         public InputProperties getInputProperties() {
164                 return inputProperties;
165         }
166
167         @JsonInclude(JsonInclude.Include.NON_NULL)
168         public String getFromInputName() {
169                 return fromInputName;
170         }
171
172         public void setInputProperties(InputProperties inputProperties) {
173                 this.inputProperties = inputProperties;
174         }
175         /**
176          * Sets the constraints.
177          *
178          * @param c the new constraints
179          */
180         public void setConstraints(List<org.onap.sdc.toscaparser.api.elements.constraints.Constraint> c) {
181                 this.constraints = c;
182         }
183         /**
184          * Gets the constraints
185          *
186          * @return the constraints
187          */
188         public List<org.onap.sdc.toscaparser.api.elements.constraints.Constraint> getConstraints() {
189                 return constraints;
190         }
191         
192         /* (non-Javadoc)
193          * @see java.lang.Object#toString()
194          */
195         @Override
196         public String toString() {
197                 return "type=" + type + ",description=" + description + ",default=" + _default;
198         }
199
200     public String getTemplateName() {
201         return templateName;
202     }
203
204     public void setTemplateName(String templateName) {
205         this.templateName = templateName;
206     }
207
208     public String getTemplateUUID() {
209         return templateUUID;
210     }
211
212     public void setTemplateUUID(String templateUUID) {
213         this.templateUUID = templateUUID;
214     }
215
216     public String getTemplateInvariantUUID() {
217         return templateInvariantUUID;
218     }
219
220     public void setTemplateInvariantUUID(String templateInvariantUUID) {
221         this.templateInvariantUUID = templateInvariantUUID;
222     }
223
224     public String getTemplateCustomizationUUID() {
225         return templateCustomizationUUID;
226     }
227
228     public void setTemplateCustomizationUUID(String templateCustomizationUUID) {
229         this.templateCustomizationUUID = templateCustomizationUUID;
230     }
231 }