aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/nbi/apis/serviceorder/model/ServiceOrder.java
blob: 4278fac517f2c10ed3a138853659bc17d52bda02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
/**
 *     Copyright (c) 2018 Orange
 *
 *     Licensed under the Apache License, Version 2.0 (the "License");
 *     you may not use this file except in compliance with the License.
 *     You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS,
 *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *     See the License for the specific language governing permissions and
 *     limitations under the License.
 */
/*
 * API ServiceOrder serviceOrder API designed for ONAP Beijing Release. This API is build from TMF
 * open API16.5 + applied TMF guideline 3.0
 *
 * OpenAPI spec version: 0.1.1_inProgress
 *
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git Do not edit the class manually.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 */

package org.onap.nbi.apis.serviceorder.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.NotEmpty;
import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
import org.onap.nbi.commons.Resource;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 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
 */
@ApiModel(
        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")
@javax.annotation.Generated(
        value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
        date = "2018-02-19T14:00:30.767Z")
@Document
@ValidServiceOrder
public class ServiceOrder implements Resource {

    @Id
    @JsonProperty("id")
    private String id = null;

    @JsonProperty("href")
    private String href = null;

    @JsonProperty("externalId")
    private String externalId = null;

    @JsonProperty("priority")
    private String priority = null;

    @JsonProperty("description")
    private String description = null;

    @JsonProperty("category")
    private String category = null;

    @JsonProperty("state")
    private StateType state = null;

    @JsonProperty("orderDate")
    private Date orderDate = null;

    @JsonProperty("completionDateTime")
    private Date completionDateTime = null;

    @JsonProperty("expectedCompletionDate")
    private Date expectedCompletionDate = null;

    @JsonProperty("requestedStartDate")
    private Date requestedStartDate = null;

    @JsonProperty("requestedCompletionDate")
    private Date requestedCompletionDate = null;

    @JsonProperty("startDate")
    private Date startDate = null;

    @JsonProperty("@baseType")
    private String baseType = null;

    @JsonProperty("@type")
    private String type = null;

    @JsonProperty("@schemaLocation")
    private String schemaLocation = null;

    @JsonProperty("relatedParty")
    private List<RelatedParty> relatedParty = null;

    @JsonProperty("orderRelationship")
    private List<OrderRelationship> orderRelationship = null;

    @JsonProperty("orderItem")
    private List<ServiceOrderItem> orderItem = null;

    @JsonProperty("orderMessage")
    private List<OrderMessage> orderMessage = null;

    public ServiceOrder id(String id) {
        this.id = id;
        return this;
    }

    /**
     * ID created on repository side
     *
     * @return id
     **/
    @Override
    @JsonProperty("id")
    @ApiModelProperty(required = true, value = "ID created on repository side")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public ServiceOrder href(String href) {
        this.href = href;
        return this;
    }

    /**
     * Hyperlink to access the order
     *
     * @return href
     **/
    @JsonProperty("href")
    @ApiModelProperty(value = "Hyperlink to access the order")
    public String getHref() {
        return href;
    }

    public void setHref(String href) {
        this.href = href;
    }

    public ServiceOrder externalId(String externalId) {
        this.externalId = externalId;
        return this;
    }

    /**
     * ID given by the consumer and only understandable by him (to facilitate his searches)
     *
     * @return externalId
     **/
    @JsonProperty("externalId")
    @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
    public String getExternalId() {
        return externalId;
    }

    public void setExternalId(String externalId) {
        this.externalId = externalId;
    }

    public ServiceOrder priority(String priority) {
        this.priority = priority;
        return this;
    }

    /**
     * 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)
     *
     * @return priority
     **/
    @JsonProperty("priority")
    @ApiModelProperty(
            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)")
    public String getPriority() {
        return priority;
    }

    public void setPriority(String priority) {
        this.priority = priority;
    }

    public ServiceOrder description(String description) {
        this.description = description;
        return this;
    }

    /**
     * A free-text description of the service order
     *
     * @return description
     **/
    @JsonProperty("description")
    @ApiModelProperty(value = "A free-text description of the service order")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public ServiceOrder category(String category) {
        this.category = category;
        return this;
    }

    /**
     * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
     * “TVOption”, ...)
     *
     * @return category
     **/
    @JsonProperty("category")
    @ApiModelProperty(
            value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public ServiceOrder state(StateType state) {
        this.state = state;
        return this;
    }

    /**
     * State of the order : described in the state-machine diagram
     *
     * @return state
     **/
    @JsonProperty("state")
    @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
    public StateType getState() {
        return state;
    }

    public void setState(StateType state) {
        this.state = state;
    }

    public ServiceOrder orderDate(Date orderDate) {
        this.orderDate = orderDate;
        return this;
    }

    /**
     * @return orderDate
     **/
    @JsonProperty("orderDate")
    @ApiModelProperty(value = "")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public ServiceOrder completionDateTime(Date completionDateTime) {
        this.completionDateTime = completionDateTime;
        return this;
    }

    /**
     * Date when the order was completed
     *
     * @return completionDateTime
     **/
    @JsonProperty("completionDateTime")
    @ApiModelProperty(value = "Date when the order was completed")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getCompletionDateTime() {
        return completionDateTime;
    }

    public void setCompletionDateTime(Date completionDateTime) {
        this.completionDateTime = completionDateTime;
    }

    /**
     * @return expectedCompletionDate
     **/
    @JsonProperty("expectedCompletionDate")
    @ApiModelProperty(value = "")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getExpectedCompletionDate() {
        return expectedCompletionDate;
    }

    public void setExpectedCompletionDate(Date expectedCompletionDate) {
        this.expectedCompletionDate = expectedCompletionDate;
    }

    public ServiceOrder requestedStartDate(Date requestedStartDate) {
        this.requestedStartDate = requestedStartDate;
        return this;
    }

    /**
     * Order start date wished by the requestor
     *
     * @return requestedStartDate
     **/
    @JsonProperty("requestedStartDate")
    @ApiModelProperty(value = "Order start date wished by the requestor")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getRequestedStartDate() {
        return requestedStartDate;
    }

    public void setRequestedStartDate(Date requestedStartDate) {
        this.requestedStartDate = requestedStartDate;
    }

    public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
        this.requestedCompletionDate = requestedCompletionDate;
        return this;
    }

    /**
     * Requested delivery date from the requestor perspective
     *
     * @return requestedCompletionDate
     **/
    @JsonProperty("requestedCompletionDate")
    @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getRequestedCompletionDate() {
        return requestedCompletionDate;
    }

    public void setRequestedCompletionDate(Date requestedCompletionDate) {
        this.requestedCompletionDate = requestedCompletionDate;
    }

    public ServiceOrder startDate(Date startDate) {
        this.startDate = startDate;
        return this;
    }

    /**
     * Date when the order was started for processing
     *
     * @return startDate
     **/
    @JsonProperty("startDate")
    @ApiModelProperty(value = "Date when the order was started for processing")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public ServiceOrder baseType(String baseType) {
        this.baseType = baseType;
        return this;
    }

    /**
     * @return baseType
     **/
    @JsonProperty("@baseType")
    @ApiModelProperty(value = "")
    public String getBaseType() {
        return baseType;
    }

    public void setBaseType(String baseType) {
        this.baseType = baseType;
    }

    public ServiceOrder type(String type) {
        this.type = type;
        return this;
    }

    /**
     * @return type
     **/
    @JsonProperty("@type")
    @ApiModelProperty(value = "")
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public ServiceOrder schemaLocation(String schemaLocation) {
        this.schemaLocation = schemaLocation;
        return this;
    }

    /**
     * @return schemaLocation
     **/
    @JsonProperty("@schemaLocation")
    @ApiModelProperty(value = "")
    public String getSchemaLocation() {
        return schemaLocation;
    }

    public void setSchemaLocation(String schemaLocation) {
        this.schemaLocation = schemaLocation;
    }

    public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
        this.relatedParty = relatedParty;
        return this;
    }

    public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
        if (this.relatedParty == null) {
            this.relatedParty = new ArrayList<RelatedParty>();
        }
        this.relatedParty.add(relatedPartyItem);
        return this;
    }

    /**
     * A list of related parties which are involved in this order and the role they are playing.
     *
     * @return relatedParty
     **/
    @JsonProperty("relatedParty")
    @ApiModelProperty(
            value = "A list of related parties which are involved in this order and the role they are playing.")
    @Valid
    public List<RelatedParty> getRelatedParty() {
        return relatedParty;
    }

    public void setRelatedParty(List<RelatedParty> relatedParty) {
        this.relatedParty = relatedParty;
    }

    public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
        this.orderRelationship = orderRelationship;
        return this;
    }

    public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
        if (this.orderRelationship == null) {
            this.orderRelationship = new ArrayList<OrderRelationship>();
        }
        this.orderRelationship.add(orderRelationshipItem);
        return this;
    }

    /**
     * A list of related order references .Linked order to the one containing this attribute
     *
     * @return orderRelationship
     **/
    @JsonProperty("orderRelationship")
    @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
    @Valid
    public List<OrderRelationship> getOrderRelationship() {
        return orderRelationship;
    }

    public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
        this.orderRelationship = orderRelationship;
    }

    public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
        this.orderItem = orderItem;
        return this;
    }

    public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
        if (this.orderItem == null) {
            this.orderItem = new ArrayList<ServiceOrderItem>();
        }
        this.orderItem.add(orderItemItem);
        return this;
    }

    /**
     * A list of order items that have to be processed.
     *
     * @return orderItem
     **/
    @JsonProperty("orderItem")
    @ApiModelProperty(value = "A list of order items that have to be processed.")
    @NotEmpty
    @Valid
    public List<ServiceOrderItem> getOrderItem() {
        return orderItem;
    }

    public void setOrderItem(List<ServiceOrderItem> orderItem) {
        this.orderItem = orderItem;
    }

    public ServiceOrder orderMessage(List<OrderMessage> orderMessage) {
        this.orderMessage = orderMessage;
        return this;
    }

    public ServiceOrder addOrderMessageItem(OrderMessage orderMessageItem) {
        if (this.orderMessage == null) {
            this.orderMessage = new ArrayList<OrderMessage>();
        }
        boolean mesageAlreadyExist = false;
        for (OrderMessage message : this.orderMessage) {
            if (message.getCode().equals(orderMessageItem.getCode())) {
                mesageAlreadyExist = true;

            }
        }
        if (!mesageAlreadyExist) {
            this.orderMessage.add(orderMessageItem);
        }
        return this;
    }

    /**
     *
     * @return orderMessage
     **/
    @JsonProperty("orderMessage")
    @ApiModelProperty(value = "")
    @Valid
    public List<OrderMessage> getOrderMessage() {
        return orderMessage;
    }

    public void setOrderMessage(List<OrderMessage> orderMessage) {
        this.orderMessage = orderMessage;
    }

    @Override
    public boolean equals(java.lang.Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ServiceOrder serviceOrder = (ServiceOrder) o;
        return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
                && Objects.equals(this.externalId, serviceOrder.externalId)
                && Objects.equals(this.priority, serviceOrder.priority)
                && Objects.equals(this.description, serviceOrder.description)
                && Objects.equals(this.category, serviceOrder.category)
                && Objects.equals(this.state, serviceOrder.state)
                && Objects.equals(this.orderDate, serviceOrder.orderDate)
                && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
                && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
                && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
                && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
                && Objects.equals(this.startDate, serviceOrder.startDate)
                && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
                && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
                && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
                && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
                && Objects.equals(this.orderItem, serviceOrder.orderItem)
                && Objects.equals(this.orderMessage, serviceOrder.orderMessage);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
                expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
                schemaLocation, relatedParty, orderRelationship, orderItem, orderMessage);
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class ServiceOrder {\n");

        sb.append("    id: ").append(toIndentedString(id)).append("\n");
        sb.append("    href: ").append(toIndentedString(href)).append("\n");
        sb.append("    externalId: ").append(toIndentedString(externalId)).append("\n");
        sb.append("    priority: ").append(toIndentedString(priority)).append("\n");
        sb.append("    description: ").append(toIndentedString(description)).append("\n");
        sb.append("    category: ").append(toIndentedString(category)).append("\n");
        sb.append("    state: ").append(toIndentedString(state)).append("\n");
        sb.append("    orderDate: ").append(toIndentedString(orderDate)).append("\n");
        sb.append("    completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
        sb.append("    expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
        sb.append("    requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
        sb.append("    requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
        sb.append("    startDate: ").append(toIndentedString(startDate)).append("\n");
        sb.append("    baseType: ").append(toIndentedString(baseType)).append("\n");
        sb.append("    type: ").append(toIndentedString(type)).append("\n");
        sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
        sb.append("    relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
        sb.append("    orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
        sb.append("    orderItem: ").append(toIndentedString(orderItem)).append("\n");
        sb.append("    orderMessage: ").append(toIndentedString(orderMessage)).append("\n");
        sb.append("}");
        return sb.toString();
    }

    /**
     * Convert the given object to string with each line indented by 4 spaces (except the first
     * line).
     */
    private String toIndentedString(java.lang.Object o) {
        if (o == null) {
            return "null";
        }
        return o.toString().replace("\n", "\n    ");
    }
}