Upgrade sonar plugin
[vid.git] / vid-app-common / src / main / java / org / openecomp / vid / model / NewService.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.openecomp.vid.model;
22
23 import java.util.Map;
24 import java.util.UUID;
25
26 import org.openecomp.vid.asdc.beans.tosca.Input;
27
28 /**
29  * The Class Service.
30  */
31 public class NewService {
32
33         /** The uuid. */
34         private String uuid;
35         
36         /** The invariant uuid. */
37         private String invariantUuid;
38         
39         /** The name. */
40         private String name;
41         
42         /** The version. */
43         private String version;
44         
45         /** The tosca model URL. */
46         private String toscaModelURL;
47         
48         /** The category. */
49         private String category;
50         
51         /** The description. */
52         private String description;
53         
54         /** The service ecomp naming flag */
55         private String serviceEcompNaming;
56         
57         /** The inputs. */
58         private Map<String, Input> inputs;
59         
60         /**
61          * Gets the uuid.
62          *
63          * @return the uuid
64          */
65         public String getUuid() {
66                 return uuid;
67         }
68         
69         /**
70          * Gets the invariant uuid.
71          *
72          * @return the invariant uuid
73          */
74         public String getInvariantUuid() {
75                 return invariantUuid;
76         }
77         
78         /**
79          * Gets the name.
80          *
81          * @return the name
82          */
83         public String getName() {
84                 return name;
85         }
86         
87         /**
88          * Gets the version.
89          *
90          * @return the version
91          */
92         public String getVersion() {
93                 return version;
94         }
95         
96         /**
97          * Gets the tosca model URL.
98          *
99          * @return the tosca model URL
100          */
101         public String getToscaModelURL() {
102                 return toscaModelURL;
103         }
104         
105         /**
106          * Gets the category.
107          *
108          * @return the category
109          */
110         public String getCategory() {
111                 return category;
112         }
113         
114         /**
115          * Gets the description.
116          *
117          * @return the description
118          */
119         public String getDescription() {
120                 return description;
121         }
122         
123         /**
124          * Gets the inputs.
125          *
126          * @return the inputs
127          */
128         public Map<String, Input> getInputs() {
129                 return inputs;
130         }
131         /**
132          * Get the serviceEcompNaming value
133          *
134          * @return serviceEcompNaming
135          */
136         public String getServiceEcompNaming() {
137                 return serviceEcompNaming;
138         } 
139         /**
140          * Sets the uuid.
141          *
142          * @param uuid the new uuid
143          */
144         public void setUuid(String uuid) {
145                 this.uuid = uuid;
146         }
147         
148         /**
149          * Sets the invariant uuid.
150          *
151          * @param invariantUuid the new invariant uuid
152          */
153         public void setInvariantUuid(String invariantUuid) {
154                 this.invariantUuid = invariantUuid;
155         }
156         
157         /**
158          * Sets the name.
159          *
160          * @param name the new name
161          */
162         public void setName(String name) {
163                 this.name = name;
164         }
165         
166         /**
167          * Sets the version.
168          *
169          * @param version the new version
170          */
171         public void setVersion(String version) {
172                 this.version = version;
173         }
174         
175         /**
176          * Sets the tosca model URL.
177          *
178          * @param toscaModelURL the new tosca model URL
179          */
180         public void setToscaModelURL(String toscaModelURL) {
181                 this.toscaModelURL = toscaModelURL;
182         }
183         
184         /**
185          * Sets the category.
186          *
187          * @param category the new category
188          */
189         public void setCategory(String category) {
190                 this.category = category;
191         }
192         
193         /**
194          * Sets the description.
195          *
196          * @param description the new description
197          */
198         public void setDescription(String description) {
199                 this.description = description;
200         }
201         
202         /**
203          * Sets the inputs.
204          *
205          * @param inputs the inputs
206          */
207         public void setInputs(Map<String, Input> inputs) {
208                 this.inputs = inputs;
209         }
210         /**
211          * Sets the service ecomp naming.
212          *
213          * @param serviceEcompNaming the new service ecomp naming
214          */
215         public void setServiceEcompNaming(String serviceEcompNaming) {
216                 this.serviceEcompNaming = serviceEcompNaming;
217         }
218         /* (non-Javadoc)
219          * @see java.lang.Object#hashCode()
220          */
221         @Override
222         public int hashCode() {
223                 final UUID uuid = UUID.fromString(getUuid());
224                 
225                 return uuid.hashCode();
226         }
227         
228         /* (non-Javadoc)
229          * @see java.lang.Object#equals(java.lang.Object)
230          */
231         @Override
232         public boolean equals(Object o) {
233                 if (o == this) return true;
234                 if (!(o instanceof NewService)) return false;
235                 
236                 final NewService service = (NewService) o;
237                 
238                 return (service.getUuid().equals(getUuid()));
239         }
240         /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
241                 
242                 //Look for vnfCustomizationName..vfModuleCustomizationName
243                 String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
244                 for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
245                         VfModule xMod = vfModuleComponent.getValue();
246                         if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
247                                 vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
248                                 return;
249                         }
250                 }
251         }*/
252 }