2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.vid.model;
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import org.onap.vid.asdc.beans.tosca.Input;
27 import java.util.UUID;
32 public class Service {
37 /** The invariant uuid. */
38 private String invariantUuid;
44 private String version;
46 /** The tosca model URL. */
47 private String toscaModelURL;
50 private String category;
52 /** The Service Type. */
53 private String serviceType;
55 /** The Service Role */
56 private String serviceRole;
58 /** The description. */
59 private String description;
61 /** The service ecomp naming flag */
62 private String serviceEcompNaming;
64 private String instantiationType;
68 private Map<String, Input> inputs;
70 private VidNotions vidNotions;
77 public String getUuid() {
82 * Gets the invariant uuid.
84 * @return the invariant uuid
86 public String getInvariantUuid() {
95 public String getName() {
102 * @return the version
104 public String getVersion() {
109 * Gets the tosca model URL.
111 * @return the tosca model URL
113 public String getToscaModelURL() {
114 return toscaModelURL;
120 * @return the category
122 public String getCategory() {
127 * Gets the description.
129 * @return the description
131 public String getDescription() {
140 public Map<String, Input> getInputs() {
144 * Get the serviceEcompNaming value
146 * @return serviceEcompNaming
148 public String getServiceEcompNaming() {
149 return serviceEcompNaming;
153 public String getInstantiationType() { return instantiationType; }
155 public void setInstantiationType(String instantiationType) { this.instantiationType = instantiationType; }
159 * @param uuid the new uuid
161 public void setUuid(String uuid) {
166 * Sets the invariant uuid.
168 * @param invariantUuid the new invariant uuid
170 public void setInvariantUuid(String invariantUuid) {
171 this.invariantUuid = invariantUuid;
177 * @param name the new name
179 public void setName(String name) {
186 * @param version the new version
188 public void setVersion(String version) {
189 this.version = version;
193 * Sets the tosca model URL.
195 * @param toscaModelURL the new tosca model URL
197 public void setToscaModelURL(String toscaModelURL) {
198 this.toscaModelURL = toscaModelURL;
204 * @param category the new category
206 public void setCategory(String category) {
207 this.category = category;
211 * Sets the description.
213 * @param description the new description
215 public void setDescription(String description) {
216 this.description = description;
222 * @param inputs the inputs
224 public void setInputs(Map<String, Input> inputs) {
225 this.inputs = inputs;
228 * Sets the service ecomp naming.
230 * @param serviceEcompNaming the new service ecomp naming
232 public void setServiceEcompNaming(String serviceEcompNaming) {
233 this.serviceEcompNaming = serviceEcompNaming;
236 * @see java.lang.Object#hashCode()
239 public int hashCode() {
240 return UUID.fromString(getUuid()).hashCode();
244 * @see java.lang.Object#equals(java.lang.Object)
247 public boolean equals(Object o) {
248 if (o == this) return true;
249 if (!(o instanceof Service)) return false;
251 final Service service = (Service) o;
253 return (service.getUuid().equals(getUuid()));
256 public String getServiceType() {
260 public void setServiceType(String serviceType) {
261 this.serviceType = serviceType;
264 public String getServiceRole() {
268 public void setServiceRole(String serviceRole) {
269 this.serviceRole = serviceRole;
272 @JsonInclude(JsonInclude.Include.NON_NULL)
273 public VidNotions getVidNotions() {
277 public void setVidNotions(VidNotions vidNotions) {
278 this.vidNotions = vidNotions;