Format Java code with respect to ONAP Code Style
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / Service.java
1 /**
2  *     Copyright (c) 2018 Orange
3  *
4  *     Licensed under the Apache License, Version 2.0 (the "License");
5  *     you may not use this file except in compliance with the License.
6  *     You may obtain a copy of the License at
7  *
8  *         http://www.apache.org/licenses/LICENSE-2.0
9  *
10  *     Unless required by applicable law or agreed to in writing, software
11  *     distributed under the License is distributed on an "AS IS" BASIS,
12  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  *     See the License for the specific language governing permissions and
14  *     limitations under the License.
15  */
16 /*
17  * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
18  * open API16.5 + applied TMF guideline 3.0
19  *
20  * OpenAPI spec version: 0.1.1_inProgress
21  * 
22  *
23  * NOTE: This class is auto generated by the swagger code generator program.
24  * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
25  *
26  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
27  * in compliance with the License. You may obtain a copy of the License at
28  *
29  * http://www.apache.org/licenses/LICENSE-2.0
30  *
31  * Unless required by applicable law or agreed to in writing, software distributed under the License
32  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
33  * or implied. See the License for the specific language governing permissions and limitations under
34  * the License.
35  */
36
37 package org.onap.nbi.apis.serviceorder.model;
38
39 import com.fasterxml.jackson.annotation.JsonProperty;
40 import io.swagger.annotations.ApiModel;
41 import io.swagger.annotations.ApiModelProperty;
42 import javax.validation.Valid;
43 import javax.validation.constraints.NotNull;
44 import java.util.ArrayList;
45 import java.util.List;
46 import java.util.Objects;
47
48 /**
49  * Service attributes description (these are as per the Service ODE model as used in the Service
50  * Inventory specification)
51  */
52 @ApiModel(
53         description = "Service attributes description (these are as per the Service ODE model as used in the Service Inventory specification)")
54 @javax.annotation.Generated(
55         value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
56         date = "2018-02-19T14:00:30.767Z")
57 public class Service {
58     @JsonProperty("id")
59     private String id = null;
60
61     @JsonProperty("href")
62     private String href = null;
63
64     @JsonProperty("name")
65     private String name = null;
66
67     @JsonProperty("serviceState")
68     private String serviceState = null;
69
70     @JsonProperty("@type")
71     private String type = null;
72
73     @JsonProperty("@schemaLocation")
74     private String schemaLocation = null;
75
76     @JsonProperty("serviceCharacteristic")
77     private List<ServiceCharacteristic> serviceCharacteristic = null;
78
79     @JsonProperty("serviceRelationship")
80     private List<ServiceRelationship> serviceRelationship = null;
81
82     @JsonProperty("relatedParty")
83     private List<RelatedParty> relatedParty = null;
84
85     @JsonProperty("serviceSpecification")
86     private ServiceSpecificationRef serviceSpecification = null;
87
88     public Service id(String id) {
89         this.id = id;
90         return this;
91     }
92
93     /**
94      * Identifier of a service instance
95      *
96      * @return id
97      **/
98     @JsonProperty("id")
99     @ApiModelProperty(value = "Identifier of a service instance")
100     public String getId() {
101         return id;
102     }
103
104     public void setId(String id) {
105         this.id = id;
106     }
107
108     public Service href(String href) {
109         this.href = href;
110         return this;
111     }
112
113     /**
114      * Reference to the owned Service (useful for delete or modify command)
115      *
116      * @return href
117      **/
118     @JsonProperty("href")
119     @ApiModelProperty(value = "Reference to the owned Service (useful for delete or modify command)")
120     public String getHref() {
121         return href;
122     }
123
124     public void setHref(String href) {
125         this.href = href;
126     }
127
128     public Service name(String name) {
129         this.name = name;
130         return this;
131     }
132
133     /**
134      * Name of the service
135      *
136      * @return name
137      **/
138     @JsonProperty("name")
139     @ApiModelProperty(value = "Name of the service")
140     public String getName() {
141         return name;
142     }
143
144     public void setName(String name) {
145         this.name = name;
146     }
147
148     public Service serviceState(String serviceState) {
149         this.serviceState = serviceState;
150         return this;
151     }
152
153     /**
154      * The lifecycle state of the service
155      *
156      * @return serviceState
157      **/
158     @JsonProperty("serviceState")
159     @ApiModelProperty(value = "The lifecycle state of the service")
160     public String getServiceState() {
161         return serviceState;
162     }
163
164     public void setServiceState(String serviceState) {
165         this.serviceState = serviceState;
166     }
167
168     public Service type(String type) {
169         this.type = type;
170         return this;
171     }
172
173     /**
174      * @return type
175      **/
176     @JsonProperty("@type")
177     @ApiModelProperty(value = "")
178     public String getType() {
179         return type;
180     }
181
182     public void setType(String type) {
183         this.type = type;
184     }
185
186     public Service schemaLocation(String schemaLocation) {
187         this.schemaLocation = schemaLocation;
188         return this;
189     }
190
191     /**
192      * @return schemaLocation
193      **/
194     @JsonProperty("@schemaLocation")
195     @ApiModelProperty(value = "")
196     public String getSchemaLocation() {
197         return schemaLocation;
198     }
199
200     public void setSchemaLocation(String schemaLocation) {
201         this.schemaLocation = schemaLocation;
202     }
203
204     public Service serviceCharacteristic(List<ServiceCharacteristic> serviceCharacteristic) {
205         this.serviceCharacteristic = serviceCharacteristic;
206         return this;
207     }
208
209     public Service addServiceCharacteristicItem(ServiceCharacteristic serviceCharacteristicItem) {
210         if (this.serviceCharacteristic == null) {
211             this.serviceCharacteristic = new ArrayList<ServiceCharacteristic>();
212         }
213         this.serviceCharacteristic.add(serviceCharacteristicItem);
214         return this;
215     }
216
217     /**
218      * A list of service characteristics .A name/value pair list used to store instance specific
219      * values of attributes. The behavior is equivalent to a MAP data structure where only one entry
220      * for any given value of \&quot;name\&quot; can exist
221      *
222      * @return serviceCharacteristic
223      **/
224     @JsonProperty("serviceCharacteristic")
225     @ApiModelProperty(
226             value = "A list of service characteristics .A name/value pair list used to store instance specific values of attributes. The behavior is equivalent to a MAP data structure where only one entry for any given value of \"name\" can exist")
227     @Valid
228     public List<ServiceCharacteristic> getServiceCharacteristic() {
229         return serviceCharacteristic;
230     }
231
232     public void setServiceCharacteristic(List<ServiceCharacteristic> serviceCharacteristic) {
233         this.serviceCharacteristic = serviceCharacteristic;
234     }
235
236     public Service serviceRelationship(List<ServiceRelationship> serviceRelationship) {
237         this.serviceRelationship = serviceRelationship;
238         return this;
239     }
240
241     public Service addServiceRelationshipItem(ServiceRelationship serviceRelationshipItem) {
242         if (this.serviceRelationship == null) {
243             this.serviceRelationship = new ArrayList<ServiceRelationship>();
244         }
245         this.serviceRelationship.add(serviceRelationshipItem);
246         return this;
247     }
248
249     /**
250      * A list or service relationships (ServiceRelationship[*]). Linked Services to the one
251      * instantiate, it can be : “reliesOn” if the Service needs another already owned Service to
252      * rely on (e.g. an option on an already owned mobile access Service) or “targets” or
253      * “isTargeted” (depending on the way of expressing the link) for any other kind of links that
254      * may be useful
255      *
256      * @return serviceRelationship
257      **/
258     @JsonProperty("serviceRelationship")
259     @ApiModelProperty(
260             value = "A list or service relationships (ServiceRelationship[*]). Linked Services to the one instantiate, it can be : “reliesOn” if the Service needs another already owned Service to rely on (e.g. an option on an already owned mobile access Service) or “targets” or “isTargeted” (depending on the way of expressing the link) for any other kind of links that may be useful")
261     @Valid
262     public List<ServiceRelationship> getServiceRelationship() {
263         return serviceRelationship;
264     }
265
266     public void setServiceRelationship(List<ServiceRelationship> serviceRelationship) {
267         this.serviceRelationship = serviceRelationship;
268     }
269
270     public Service relatedParty(List<RelatedParty> relatedParty) {
271         this.relatedParty = relatedParty;
272         return this;
273     }
274
275     public Service addRelatedPartyItem(RelatedParty relatedPartyItem) {
276         if (this.relatedParty == null) {
277             this.relatedParty = new ArrayList<RelatedParty>();
278         }
279         this.relatedParty.add(relatedPartyItem);
280         return this;
281     }
282
283     /**
284      * A list of related party parties linked at the Service level (it may be a User for example)
285      *
286      * @return relatedParty
287      **/
288     @JsonProperty("relatedParty")
289     @ApiModelProperty(
290             value = "A list of related party parties linked at the Service level (it may be a User for example)")
291     @Valid
292     public List<RelatedParty> getRelatedParty() {
293         return relatedParty;
294     }
295
296     public void setRelatedParty(List<RelatedParty> relatedParty) {
297         this.relatedParty = relatedParty;
298     }
299
300     public Service serviceSpecification(ServiceSpecificationRef serviceSpecification) {
301         this.serviceSpecification = serviceSpecification;
302         return this;
303     }
304
305     /**
306      * @return serviceSpecification
307      **/
308     @JsonProperty("serviceSpecification")
309     @ApiModelProperty(value = "")
310     @NotNull(message = "ServiceSpecification cannot be null")
311     @Valid
312     public ServiceSpecificationRef getServiceSpecification() {
313         return serviceSpecification;
314     }
315
316     public void setServiceSpecification(ServiceSpecificationRef serviceSpecification) {
317         this.serviceSpecification = serviceSpecification;
318     }
319
320     @Override
321     public boolean equals(java.lang.Object o) {
322         if (this == o) {
323             return true;
324         }
325         if (o == null || getClass() != o.getClass()) {
326             return false;
327         }
328         Service service = (Service) o;
329         return Objects.equals(this.id, service.id) && Objects.equals(this.href, service.href)
330                 && Objects.equals(this.name, service.name) && Objects.equals(this.serviceState, service.serviceState)
331                 && Objects.equals(this.type, service.type)
332                 && Objects.equals(this.schemaLocation, service.schemaLocation)
333                 && Objects.equals(this.serviceCharacteristic, service.serviceCharacteristic)
334                 && Objects.equals(this.serviceRelationship, service.serviceRelationship)
335                 && Objects.equals(this.relatedParty, service.relatedParty)
336                 && Objects.equals(this.serviceSpecification, service.serviceSpecification);
337     }
338
339     @Override
340     public int hashCode() {
341         return Objects.hash(id, href, name, serviceState, type, schemaLocation, serviceCharacteristic,
342                 serviceRelationship, relatedParty, serviceSpecification);
343     }
344
345     @Override
346     public String toString() {
347         StringBuilder sb = new StringBuilder();
348         sb.append("class Service {\n");
349
350         sb.append("    id: ").append(toIndentedString(id)).append("\n");
351         sb.append("    href: ").append(toIndentedString(href)).append("\n");
352         sb.append("    name: ").append(toIndentedString(name)).append("\n");
353         sb.append("    serviceState: ").append(toIndentedString(serviceState)).append("\n");
354         sb.append("    type: ").append(toIndentedString(type)).append("\n");
355         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
356         sb.append("    serviceCharacteristic: ").append(toIndentedString(serviceCharacteristic)).append("\n");
357         sb.append("    serviceRelationship: ").append(toIndentedString(serviceRelationship)).append("\n");
358         sb.append("    relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
359         sb.append("    serviceSpecification: ").append(toIndentedString(serviceSpecification)).append("\n");
360         sb.append("}");
361         return sb.toString();
362     }
363
364     /**
365      * Convert the given object to string with each line indented by 4 spaces (except the first
366      * line).
367      */
368     private String toIndentedString(java.lang.Object o) {
369         if (o == null) {
370             return "null";
371         }
372         return o.toString().replace("\n", "\n    ");
373     }
374 }