Merge "Add Apache license header per file"
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceOrder.java
1 /**
2  *
3  *     Copyright (c) 2017 Orange.  All rights reserved.
4  *
5  *     Licensed under the Apache License, Version 2.0 (the "License");
6  *     you may not use this file except in compliance with the License.
7  *     You may obtain a copy of the License at
8  *
9  *         http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *     Unless required by applicable law or agreed to in writing, software
12  *     distributed under the License is distributed on an "AS IS" BASIS,
13  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *     See the License for the specific language governing permissions and
15  *     limitations under the License.
16  */
17 /*
18  * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
19  * open API16.5 + applied TMF guideline 3.0
20  *
21  * OpenAPI spec version: 0.1.1_inProgress
22  *
23  *
24  * NOTE: This class is auto generated by the swagger code generator program.
25  * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
26  *
27  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
28  * in compliance with the License. You may obtain a copy of the License at
29  *
30  * http://www.apache.org/licenses/LICENSE-2.0
31  *
32  * Unless required by applicable law or agreed to in writing, software distributed under the License
33  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
34  * or implied. See the License for the specific language governing permissions and limitations under
35  * the License.
36  */
37
38
39 package org.onap.nbi.apis.serviceorder.model;
40
41 import java.util.ArrayList;
42 import java.util.Date;
43 import java.util.List;
44 import java.util.Objects;
45 import org.hibernate.validator.constraints.NotEmpty;
46 import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
47 import org.onap.nbi.commons.Resource;
48 import org.springframework.data.annotation.Id;
49 import org.springframework.data.mongodb.core.mapping.Document;
50 import com.fasterxml.jackson.annotation.JsonFormat;
51 import com.fasterxml.jackson.annotation.JsonProperty;
52 import io.swagger.annotations.ApiModel;
53 import io.swagger.annotations.ApiModelProperty;
54
55 /**
56  * A Service Order is a type of order which can be used to place an order between a customer and a
57  * service provider or between a service provider and a partner and vice versa
58  */
59 @ApiModel(
60         description = "A Service Order is a type of order which can be used to place an order between a customer and a service provider or between a service provider and a partner and vice versa")
61 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
62         date = "2018-02-19T14:00:30.767Z")
63 @Document
64 @ValidServiceOrder
65 public class ServiceOrder implements Resource {
66
67     @Id
68     @JsonProperty("id")
69     private String id = null;
70
71     @JsonProperty("href")
72     private String href = null;
73
74     @JsonProperty("externalId")
75     private String externalId = null;
76
77     @JsonProperty("priority")
78     private String priority = null;
79
80     @JsonProperty("description")
81     private String description = null;
82
83     @JsonProperty("category")
84     private String category = null;
85
86     @JsonProperty("state")
87     private StateType state = null;
88
89     @JsonProperty("orderDate")
90     private Date orderDate = null;
91
92     @JsonProperty("completionDateTime")
93     private Date completionDateTime = null;
94
95     @JsonProperty("expectedCompletionDate")
96     private Date expectedCompletionDate = null;
97
98     @JsonProperty("requestedStartDate")
99     private Date requestedStartDate = null;
100
101     @JsonProperty("requestedCompletionDate")
102     private Date requestedCompletionDate = null;
103
104     @JsonProperty("startDate")
105     private Date startDate = null;
106
107     @JsonProperty("@baseType")
108     private String baseType = null;
109
110     @JsonProperty("@type")
111     private String type = null;
112
113     @JsonProperty("@schemaLocation")
114     private String schemaLocation = null;
115
116     @JsonProperty("relatedParty")
117     private List<RelatedParty> relatedParty = null;
118
119     @JsonProperty("orderRelationship")
120     private List<OrderRelationship> orderRelationship = null;
121
122     @JsonProperty("orderItem")
123     private List<ServiceOrderItem> orderItem = null;
124
125     public ServiceOrder id(String id) {
126         this.id = id;
127         return this;
128     }
129
130
131     /**
132      * ID created on repository side
133      *
134      * @return id
135      **/
136     @Override
137     @JsonProperty("id")
138     @ApiModelProperty(required = true, value = "ID created on repository side")
139     public String getId() {
140         return id;
141     }
142
143     public void setId(String id) {
144         this.id = id;
145     }
146
147     public ServiceOrder href(String href) {
148         this.href = href;
149         return this;
150     }
151
152     /**
153      * Hyperlink to access the order
154      *
155      * @return href
156      **/
157     @JsonProperty("href")
158     @ApiModelProperty(value = "Hyperlink to access the order")
159     public String getHref() {
160         return href;
161     }
162
163     public void setHref(String href) {
164         this.href = href;
165     }
166
167     public ServiceOrder externalId(String externalId) {
168         this.externalId = externalId;
169         return this;
170     }
171
172     /**
173      * ID given by the consumer and only understandable by him (to facilitate his searches)
174      *
175      * @return externalId
176      **/
177     @JsonProperty("externalId")
178     @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
179     public String getExternalId() {
180         return externalId;
181     }
182
183     public void setExternalId(String externalId) {
184         this.externalId = externalId;
185     }
186
187     public ServiceOrder priority(String priority) {
188         this.priority = priority;
189         return this;
190     }
191
192     /**
193      * A way that can be used by consumers to prioritize orders in Service Order Management system
194      * (from 0 to 4 : 0 is the highest priority, and 4 the lowest)
195      *
196      * @return priority
197      **/
198     @JsonProperty("priority")
199     @ApiModelProperty(
200             value = "A way that can be used by consumers to prioritize orders in Service Order Management system (from 0 to 4 : 0 is the highest priority, and 4 the lowest)")
201     public String getPriority() {
202         return priority;
203     }
204
205     public void setPriority(String priority) {
206         this.priority = priority;
207     }
208
209     public ServiceOrder description(String description) {
210         this.description = description;
211         return this;
212     }
213
214     /**
215      * A free-text description of the service order
216      *
217      * @return description
218      **/
219     @JsonProperty("description")
220     @ApiModelProperty(value = "A free-text description of the service order")
221     public String getDescription() {
222         return description;
223     }
224
225     public void setDescription(String description) {
226         this.description = description;
227     }
228
229     public ServiceOrder category(String category) {
230         this.category = category;
231         return this;
232     }
233
234     /**
235      * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
236      * “TVOption”, ...)
237      *
238      * @return category
239      **/
240     @JsonProperty("category")
241     @ApiModelProperty(
242             value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
243     public String getCategory() {
244         return category;
245     }
246
247     public void setCategory(String category) {
248         this.category = category;
249     }
250
251     public ServiceOrder state(StateType state) {
252         this.state = state;
253         return this;
254     }
255
256     /**
257      * State of the order : described in the state-machine diagram
258      *
259      * @return state
260      **/
261     @JsonProperty("state")
262     @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
263     public StateType getState() {
264         return state;
265     }
266
267     public void setState(StateType state) {
268         this.state = state;
269     }
270
271     public ServiceOrder orderDate(Date orderDate) {
272         this.orderDate = orderDate;
273         return this;
274     }
275
276     /**
277      * @return orderDate
278      **/
279     @JsonProperty("orderDate")
280     @ApiModelProperty(value = "")
281     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
282     public Date getOrderDate() {
283         return orderDate;
284     }
285
286     public void setOrderDate(Date orderDate) {
287         this.orderDate = orderDate;
288     }
289
290     public ServiceOrder completionDateTime(Date completionDateTime) {
291         this.completionDateTime = completionDateTime;
292         return this;
293     }
294
295     /**
296      * Date when the order was completed
297      *
298      * @return completionDateTime
299      **/
300     @JsonProperty("completionDateTime")
301     @ApiModelProperty(value = "Date when the order was completed")
302     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
303     public Date getCompletionDateTime() {
304         return completionDateTime;
305     }
306
307     public void setCompletionDateTime(Date completionDateTime) {
308         this.completionDateTime = completionDateTime;
309     }
310
311
312     /**
313      * @return expectedCompletionDate
314      **/
315     @JsonProperty("expectedCompletionDate")
316     @ApiModelProperty(value = "")
317     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
318     public Date getExpectedCompletionDate() {
319         return expectedCompletionDate;
320     }
321
322     public void setExpectedCompletionDate(Date expectedCompletionDate) {
323         this.expectedCompletionDate = expectedCompletionDate;
324     }
325
326     public ServiceOrder requestedStartDate(Date requestedStartDate) {
327         this.requestedStartDate = requestedStartDate;
328         return this;
329     }
330
331     /**
332      * Order start date wished by the requestor
333      *
334      * @return requestedStartDate
335      **/
336     @JsonProperty("requestedStartDate")
337     @ApiModelProperty(value = "Order start date wished by the requestor")
338     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
339     public Date getRequestedStartDate() {
340         return requestedStartDate;
341     }
342
343     public void setRequestedStartDate(Date requestedStartDate) {
344         this.requestedStartDate = requestedStartDate;
345     }
346
347     public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
348         this.requestedCompletionDate = requestedCompletionDate;
349         return this;
350     }
351
352     /**
353      * Requested delivery date from the requestor perspective
354      *
355      * @return requestedCompletionDate
356      **/
357     @JsonProperty("requestedCompletionDate")
358     @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
359     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
360     public Date getRequestedCompletionDate() {
361         return requestedCompletionDate;
362     }
363
364     public void setRequestedCompletionDate(Date requestedCompletionDate) {
365         this.requestedCompletionDate = requestedCompletionDate;
366     }
367
368     public ServiceOrder startDate(Date startDate) {
369         this.startDate = startDate;
370         return this;
371     }
372
373     /**
374      * Date when the order was started for processing
375      *
376      * @return startDate
377      **/
378     @JsonProperty("startDate")
379     @ApiModelProperty(value = "Date when the order was started for processing")
380     @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
381     public Date getStartDate() {
382         return startDate;
383     }
384
385     public void setStartDate(Date startDate) {
386         this.startDate = startDate;
387     }
388
389     public ServiceOrder baseType(String baseType) {
390         this.baseType = baseType;
391         return this;
392     }
393
394     /**
395      * @return baseType
396      **/
397     @JsonProperty("@baseType")
398     @ApiModelProperty(value = "")
399     public String getBaseType() {
400         return baseType;
401     }
402
403     public void setBaseType(String baseType) {
404         this.baseType = baseType;
405     }
406
407     public ServiceOrder type(String type) {
408         this.type = type;
409         return this;
410     }
411
412     /**
413      * @return type
414      **/
415     @JsonProperty("@type")
416     @ApiModelProperty(value = "")
417     public String getType() {
418         return type;
419     }
420
421     public void setType(String type) {
422         this.type = type;
423     }
424
425     public ServiceOrder schemaLocation(String schemaLocation) {
426         this.schemaLocation = schemaLocation;
427         return this;
428     }
429
430     /**
431      * @return schemaLocation
432      **/
433     @JsonProperty("@schemaLocation")
434     @ApiModelProperty(value = "")
435     public String getSchemaLocation() {
436         return schemaLocation;
437     }
438
439     public void setSchemaLocation(String schemaLocation) {
440         this.schemaLocation = schemaLocation;
441     }
442
443     public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
444         this.relatedParty = relatedParty;
445         return this;
446     }
447
448     public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
449         if (this.relatedParty == null) {
450             this.relatedParty = new ArrayList<RelatedParty>();
451         }
452         this.relatedParty.add(relatedPartyItem);
453         return this;
454     }
455
456     /**
457      * A list of related parties which are involved in this order and the role they are playing.
458      *
459      * @return relatedParty
460      **/
461     @JsonProperty("relatedParty")
462     @ApiModelProperty(
463             value = "A list of related parties which are involved in this order and the role they are playing.")
464     public List<RelatedParty> getRelatedParty() {
465         return relatedParty;
466     }
467
468     public void setRelatedParty(List<RelatedParty> relatedParty) {
469         this.relatedParty = relatedParty;
470     }
471
472     public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
473         this.orderRelationship = orderRelationship;
474         return this;
475     }
476
477     public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
478         if (this.orderRelationship == null) {
479             this.orderRelationship = new ArrayList<OrderRelationship>();
480         }
481         this.orderRelationship.add(orderRelationshipItem);
482         return this;
483     }
484
485     /**
486      * A list of related order references .Linked order to the one containing this attribute
487      *
488      * @return orderRelationship
489      **/
490     @JsonProperty("orderRelationship")
491     @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
492     public List<OrderRelationship> getOrderRelationship() {
493         return orderRelationship;
494     }
495
496     public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
497         this.orderRelationship = orderRelationship;
498     }
499
500     public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
501         this.orderItem = orderItem;
502         return this;
503     }
504
505     public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
506         if (this.orderItem == null) {
507             this.orderItem = new ArrayList<ServiceOrderItem>();
508         }
509         this.orderItem.add(orderItemItem);
510         return this;
511     }
512
513     /**
514      * A list of order items that have to be processed.
515      *
516      * @return orderItem
517      **/
518     @JsonProperty("orderItem")
519     @ApiModelProperty(value = "A list of order items that have to be processed.")
520     @NotEmpty
521     public List<ServiceOrderItem> getOrderItem() {
522         return orderItem;
523     }
524
525     public void setOrderItem(List<ServiceOrderItem> orderItem) {
526         this.orderItem = orderItem;
527     }
528
529
530     @Override
531     public boolean equals(java.lang.Object o) {
532         if (this == o) {
533             return true;
534         }
535         if (o == null || getClass() != o.getClass()) {
536             return false;
537         }
538         ServiceOrder serviceOrder = (ServiceOrder) o;
539         return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
540                 && Objects.equals(this.externalId, serviceOrder.externalId)
541                 && Objects.equals(this.priority, serviceOrder.priority)
542                 && Objects.equals(this.description, serviceOrder.description)
543                 && Objects.equals(this.category, serviceOrder.category)
544                 && Objects.equals(this.state, serviceOrder.state)
545                 && Objects.equals(this.orderDate, serviceOrder.orderDate)
546                 && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
547                 && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
548                 && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
549                 && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
550                 && Objects.equals(this.startDate, serviceOrder.startDate)
551                 && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
552                 && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
553                 && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
554                 && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
555                 && Objects.equals(this.orderItem, serviceOrder.orderItem);
556     }
557
558     @Override
559     public int hashCode() {
560         return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
561                 expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
562                 schemaLocation, relatedParty, orderRelationship, orderItem);
563     }
564
565
566     @Override
567     public String toString() {
568         StringBuilder sb = new StringBuilder();
569         sb.append("class ServiceOrder {\n");
570
571         sb.append("    id: ").append(toIndentedString(id)).append("\n");
572         sb.append("    href: ").append(toIndentedString(href)).append("\n");
573         sb.append("    externalId: ").append(toIndentedString(externalId)).append("\n");
574         sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
575         sb.append("    description: ").append(toIndentedString(description)).append("\n");
576         sb.append("    category: ").append(toIndentedString(category)).append("\n");
577         sb.append("    state: ").append(toIndentedString(state)).append("\n");
578         sb.append("    orderDate: ").append(toIndentedString(orderDate)).append("\n");
579         sb.append("    completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
580         sb.append("    expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
581         sb.append("    requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
582         sb.append("    requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
583         sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
584         sb.append("    baseType: ").append(toIndentedString(baseType)).append("\n");
585         sb.append("    type: ").append(toIndentedString(type)).append("\n");
586         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
587         sb.append("    relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
588         sb.append("    orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
589         sb.append("    orderItem: ").append(toIndentedString(orderItem)).append("\n");
590         sb.append("}");
591         return sb.toString();
592     }
593
594     /**
595      * Convert the given object to string with each line indented by 4 spaces (except the first
596      * line).
597      */
598     private String toIndentedString(java.lang.Object o) {
599         if (o == null) {
600             return "null";
601         }
602         return o.toString().replace("\n", "\n    ");
603     }
604 }
605