Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / model / Service.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.model;
22
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import org.onap.vid.asdc.beans.tosca.Input;
25
26 import java.util.Map;
27 import java.util.UUID;
28
29 /**
30  * The Class Service.
31  */
32 public class Service {
33
34         /** The uuid. */
35         private String uuid;
36         
37         /** The invariant uuid. */
38         private String invariantUuid;
39         
40         /** The name. */
41         private String name;
42         
43         /** The version. */
44         private String version;
45         
46         /** The tosca model URL. */
47         private String toscaModelURL;
48         
49         /** The category. */
50         private String category;
51
52         /** The Service Type. */
53         private String serviceType;
54
55         /** The Service Role */
56         private String serviceRole;
57         
58         /** The description. */
59         private String description;
60         
61         /** The service ecomp naming flag */
62         private String serviceEcompNaming;
63
64         private String instantiationType;
65
66
67         /** The inputs. */
68         private Map<String, Input> inputs;
69
70         private VidNotions vidNotions;
71
72         /**
73          * Gets the uuid.
74          *
75          * @return the uuid
76          */
77         public String getUuid() {
78                 return uuid;
79         }
80         
81         /**
82          * Gets the invariant uuid.
83          *
84          * @return the invariant uuid
85          */
86         public String getInvariantUuid() {
87                 return invariantUuid;
88         }
89         
90         /**
91          * Gets the name.
92          *
93          * @return the name
94          */
95         public String getName() {
96                 return name;
97         }
98         
99         /**
100          * Gets the version.
101          *
102          * @return the version
103          */
104         public String getVersion() {
105                 return version;
106         }
107         
108         /**
109          * Gets the tosca model URL.
110          *
111          * @return the tosca model URL
112          */
113         public String getToscaModelURL() {
114                 return toscaModelURL;
115         }
116         
117         /**
118          * Gets the category.
119          *
120          * @return the category
121          */
122         public String getCategory() {
123                 return category;
124         }
125         
126         /**
127          * Gets the description.
128          *
129          * @return the description
130          */
131         public String getDescription() {
132                 return description;
133         }
134         
135         /**
136          * Gets the inputs.
137          *
138          * @return the inputs
139          */
140         public Map<String, Input> getInputs() {
141                 return inputs;
142         }
143         /**
144          * Get the serviceEcompNaming value
145          *
146          * @return serviceEcompNaming
147          */
148         public String getServiceEcompNaming() {
149                 return serviceEcompNaming;
150         }
151
152
153         public String getInstantiationType() { return instantiationType; }
154
155         public void setInstantiationType(String instantiationType) { this.instantiationType = instantiationType; }
156         /**
157          * Sets the uuid.
158          *
159          * @param uuid the new uuid
160          */
161         public void setUuid(String uuid) {
162                 this.uuid = uuid;
163         }
164         
165         /**
166          * Sets the invariant uuid.
167          *
168          * @param invariantUuid the new invariant uuid
169          */
170         public void setInvariantUuid(String invariantUuid) {
171                 this.invariantUuid = invariantUuid;
172         }
173         
174         /**
175          * Sets the name.
176          *
177          * @param name the new name
178          */
179         public void setName(String name) {
180                 this.name = name;
181         }
182         
183         /**
184          * Sets the version.
185          *
186          * @param version the new version
187          */
188         public void setVersion(String version) {
189                 this.version = version;
190         }
191         
192         /**
193          * Sets the tosca model URL.
194          *
195          * @param toscaModelURL the new tosca model URL
196          */
197         public void setToscaModelURL(String toscaModelURL) {
198                 this.toscaModelURL = toscaModelURL;
199         }
200         
201         /**
202          * Sets the category.
203          *
204          * @param category the new category
205          */
206         public void setCategory(String category) {
207                 this.category = category;
208         }
209         
210         /**
211          * Sets the description.
212          *
213          * @param description the new description
214          */
215         public void setDescription(String description) {
216                 this.description = description;
217         }
218         
219         /**
220          * Sets the inputs.
221          *
222          * @param inputs the inputs
223          */
224         public void setInputs(Map<String, Input> inputs) {
225                 this.inputs = inputs;
226         }
227         /**
228          * Sets the service ecomp naming.
229          *
230          * @param serviceEcompNaming the new service ecomp naming
231          */
232         public void setServiceEcompNaming(String serviceEcompNaming) {
233                 this.serviceEcompNaming = serviceEcompNaming;
234         }
235         /* (non-Javadoc)
236          * @see java.lang.Object#hashCode()
237          */
238         @Override
239         public int hashCode() {
240                 return UUID.fromString(getUuid()).hashCode();
241         }
242         
243         /* (non-Javadoc)
244          * @see java.lang.Object#equals(java.lang.Object)
245          */
246         @Override
247         public boolean equals(Object o) {
248                 if (o == this) return true;
249                 if (!(o instanceof Service)) return false;
250                 
251                 final Service service = (Service) o;
252                 
253                 return (service.getUuid().equals(getUuid()));
254         }
255
256         public String getServiceType() {
257                 return serviceType;
258         }
259
260         public void setServiceType(String serviceType) {
261                 this.serviceType = serviceType;
262         }
263
264         public String getServiceRole() {
265                 return serviceRole;
266         }
267
268         public void setServiceRole(String serviceRole) {
269                 this.serviceRole = serviceRole;
270         }
271
272         @JsonInclude(JsonInclude.Include.NON_NULL)
273         public VidNotions getVidNotions() {
274                 return vidNotions;
275         }
276
277         public void setVidNotions(VidNotions vidNotions) {
278                 this.vidNotions = vidNotions;
279         }
280 }