2 * Copyright (c) 2018 Orange
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
20 * OpenAPI spec version: 0.1.1_inProgress
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.
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
29 * http://www.apache.org/licenses/LICENSE-2.0
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
37 package org.onap.nbi.apis.serviceorder.model;
39 import java.util.ArrayList;
40 import java.util.Date;
41 import java.util.List;
42 import java.util.Objects;
43 import javax.validation.Valid;
44 import javax.validation.constraints.NotNull;
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;
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
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(
62 value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
63 date = "2018-02-19T14:00:30.767Z")
66 public class ServiceOrder implements Resource {
70 private String id = null;
73 private String href = null;
75 @JsonProperty("externalId")
76 private String externalId = null;
78 @JsonProperty("priority")
79 private String priority = null;
81 @JsonProperty("description")
82 private String description = null;
84 @JsonProperty("category")
85 private String category = null;
87 @JsonProperty("state")
88 private StateType state = null;
90 @JsonProperty("orderDate")
91 private Date orderDate = null;
93 @JsonProperty("completionDateTime")
94 private Date completionDateTime = null;
96 @JsonProperty("expectedCompletionDate")
97 private Date expectedCompletionDate = null;
99 @JsonProperty("requestedStartDate")
100 private Date requestedStartDate = null;
102 @JsonProperty("requestedCompletionDate")
103 private Date requestedCompletionDate = null;
105 @JsonProperty("startDate")
106 private Date startDate = null;
108 @JsonProperty("@baseType")
109 private String baseType = null;
111 @JsonProperty("@type")
112 private String type = null;
114 @JsonProperty("@schemaLocation")
115 private String schemaLocation = null;
117 @JsonProperty("relatedParty")
118 private List<RelatedParty> relatedParty = null;
120 @JsonProperty("orderRelationship")
121 private List<OrderRelationship> orderRelationship = null;
123 @JsonProperty("orderItem")
124 private List<ServiceOrderItem> orderItem = null;
126 @JsonProperty("orderMessage")
127 private List<OrderMessage> orderMessage = null;
129 public ServiceOrder id(String id) {
135 * ID created on repository side
141 @ApiModelProperty(required = true, value = "ID created on repository side")
142 public String getId() {
146 public void setId(String id) {
150 public ServiceOrder href(String href) {
156 * Hyperlink to access the order
160 @JsonProperty("href")
161 @ApiModelProperty(value = "Hyperlink to access the order")
162 public String getHref() {
166 public void setHref(String href) {
170 public ServiceOrder externalId(String externalId) {
171 this.externalId = externalId;
176 * ID given by the consumer and only understandable by him (to facilitate his searches)
180 @JsonProperty("externalId")
181 @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
182 public String getExternalId() {
186 public void setExternalId(String externalId) {
187 this.externalId = externalId;
190 public ServiceOrder priority(String priority) {
191 this.priority = priority;
196 * A way that can be used by consumers to prioritize orders in Service Order Management system
197 * (from 0 to 4 : 0 is the highest priority, and 4 the lowest)
201 @JsonProperty("priority")
203 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)")
204 public String getPriority() {
208 public void setPriority(String priority) {
209 this.priority = priority;
212 public ServiceOrder description(String description) {
213 this.description = description;
218 * A free-text description of the service order
220 * @return description
222 @JsonProperty("description")
223 @ApiModelProperty(value = "A free-text description of the service order")
224 public String getDescription() {
228 public void setDescription(String description) {
229 this.description = description;
232 public ServiceOrder category(String category) {
233 this.category = category;
238 * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
243 @JsonProperty("category")
245 value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
246 public String getCategory() {
250 public void setCategory(String category) {
251 this.category = category;
254 public ServiceOrder state(StateType state) {
260 * State of the order : described in the state-machine diagram
264 @JsonProperty("state")
265 @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
266 public StateType getState() {
270 public void setState(StateType state) {
274 public ServiceOrder orderDate(Date orderDate) {
275 this.orderDate = orderDate;
282 @JsonProperty("orderDate")
283 @ApiModelProperty(value = "")
284 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
285 public Date getOrderDate() {
289 public void setOrderDate(Date orderDate) {
290 this.orderDate = orderDate;
293 public ServiceOrder completionDateTime(Date completionDateTime) {
294 this.completionDateTime = completionDateTime;
299 * Date when the order was completed
301 * @return completionDateTime
303 @JsonProperty("completionDateTime")
304 @ApiModelProperty(value = "Date when the order was completed")
305 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
306 public Date getCompletionDateTime() {
307 return completionDateTime;
310 public void setCompletionDateTime(Date completionDateTime) {
311 this.completionDateTime = completionDateTime;
315 * @return expectedCompletionDate
317 @JsonProperty("expectedCompletionDate")
318 @ApiModelProperty(value = "")
319 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
320 public Date getExpectedCompletionDate() {
321 return expectedCompletionDate;
324 public void setExpectedCompletionDate(Date expectedCompletionDate) {
325 this.expectedCompletionDate = expectedCompletionDate;
328 public ServiceOrder requestedStartDate(Date requestedStartDate) {
329 this.requestedStartDate = requestedStartDate;
334 * Order start date wished by the requestor
336 * @return requestedStartDate
338 @JsonProperty("requestedStartDate")
339 @ApiModelProperty(value = "Order start date wished by the requestor")
340 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
341 public Date getRequestedStartDate() {
342 return requestedStartDate;
345 public void setRequestedStartDate(Date requestedStartDate) {
346 this.requestedStartDate = requestedStartDate;
349 public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
350 this.requestedCompletionDate = requestedCompletionDate;
355 * Requested delivery date from the requestor perspective
357 * @return requestedCompletionDate
359 @JsonProperty("requestedCompletionDate")
360 @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
361 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
362 public Date getRequestedCompletionDate() {
363 return requestedCompletionDate;
366 public void setRequestedCompletionDate(Date requestedCompletionDate) {
367 this.requestedCompletionDate = requestedCompletionDate;
370 public ServiceOrder startDate(Date startDate) {
371 this.startDate = startDate;
376 * Date when the order was started for processing
380 @JsonProperty("startDate")
381 @ApiModelProperty(value = "Date when the order was started for processing")
382 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
383 public Date getStartDate() {
387 public void setStartDate(Date startDate) {
388 this.startDate = startDate;
391 public ServiceOrder baseType(String baseType) {
392 this.baseType = baseType;
399 @JsonProperty("@baseType")
400 @ApiModelProperty(value = "")
401 public String getBaseType() {
405 public void setBaseType(String baseType) {
406 this.baseType = baseType;
409 public ServiceOrder type(String type) {
417 @JsonProperty("@type")
418 @ApiModelProperty(value = "")
419 public String getType() {
423 public void setType(String type) {
427 public ServiceOrder schemaLocation(String schemaLocation) {
428 this.schemaLocation = schemaLocation;
433 * @return schemaLocation
435 @JsonProperty("@schemaLocation")
436 @ApiModelProperty(value = "")
437 public String getSchemaLocation() {
438 return schemaLocation;
441 public void setSchemaLocation(String schemaLocation) {
442 this.schemaLocation = schemaLocation;
445 public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
446 this.relatedParty = relatedParty;
450 public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
451 if (this.relatedParty == null) {
452 this.relatedParty = new ArrayList<RelatedParty>();
454 this.relatedParty.add(relatedPartyItem);
459 * A list of related parties which are involved in this order and the role they are playing.
461 * @return relatedParty
463 @JsonProperty("relatedParty")
465 value = "A list of related parties which are involved in this order and the role they are playing.")
467 public List<RelatedParty> getRelatedParty() {
471 public void setRelatedParty(List<RelatedParty> relatedParty) {
472 this.relatedParty = relatedParty;
475 public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
476 this.orderRelationship = orderRelationship;
480 public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
481 if (this.orderRelationship == null) {
482 this.orderRelationship = new ArrayList<OrderRelationship>();
484 this.orderRelationship.add(orderRelationshipItem);
489 * A list of related order references .Linked order to the one containing this attribute
491 * @return orderRelationship
493 @JsonProperty("orderRelationship")
494 @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
496 public List<OrderRelationship> getOrderRelationship() {
497 return orderRelationship;
500 public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
501 this.orderRelationship = orderRelationship;
504 public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
505 this.orderItem = orderItem;
509 public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
510 if (this.orderItem == null) {
511 this.orderItem = new ArrayList<ServiceOrderItem>();
513 this.orderItem.add(orderItemItem);
518 * A list of order items that have to be processed.
522 @JsonProperty("orderItem")
523 @ApiModelProperty(value = "A list of order items that have to be processed.")
526 public List<ServiceOrderItem> getOrderItem() {
530 public void setOrderItem(List<ServiceOrderItem> orderItem) {
531 this.orderItem = orderItem;
534 public ServiceOrder orderMessage(List<OrderMessage> orderMessage) {
535 this.orderMessage = orderMessage;
539 public ServiceOrder addOrderMessageItem(OrderMessage orderMessageItem) {
540 if (this.orderMessage == null) {
541 this.orderMessage = new ArrayList<OrderMessage>();
543 boolean mesageAlreadyExist = false;
544 for (OrderMessage message : this.orderMessage) {
545 if (message.getCode().equals(orderMessageItem.getCode())) {
546 mesageAlreadyExist = true;
550 if (!mesageAlreadyExist) {
551 this.orderMessage.add(orderMessageItem);
558 * @return orderMessage
560 @JsonProperty("orderMessage")
561 @ApiModelProperty(value = "")
563 public List<OrderMessage> getOrderMessage() {
567 public void setOrderMessage(List<OrderMessage> orderMessage) {
568 this.orderMessage = orderMessage;
572 public boolean equals(java.lang.Object o) {
576 if (o == null || getClass() != o.getClass()) {
579 ServiceOrder serviceOrder = (ServiceOrder) o;
580 return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
581 && Objects.equals(this.externalId, serviceOrder.externalId)
582 && Objects.equals(this.priority, serviceOrder.priority)
583 && Objects.equals(this.description, serviceOrder.description)
584 && Objects.equals(this.category, serviceOrder.category)
585 && Objects.equals(this.state, serviceOrder.state)
586 && Objects.equals(this.orderDate, serviceOrder.orderDate)
587 && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
588 && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
589 && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
590 && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
591 && Objects.equals(this.startDate, serviceOrder.startDate)
592 && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
593 && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
594 && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
595 && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
596 && Objects.equals(this.orderItem, serviceOrder.orderItem)
597 && Objects.equals(this.orderMessage, serviceOrder.orderMessage);
601 public int hashCode() {
602 return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
603 expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
604 schemaLocation, relatedParty, orderRelationship, orderItem, orderMessage);
608 public String toString() {
609 StringBuilder sb = new StringBuilder();
610 sb.append("class ServiceOrder {\n");
612 sb.append(" id: ").append(toIndentedString(id)).append("\n");
613 sb.append(" href: ").append(toIndentedString(href)).append("\n");
614 sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n");
615 sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
616 sb.append(" description: ").append(toIndentedString(description)).append("\n");
617 sb.append(" category: ").append(toIndentedString(category)).append("\n");
618 sb.append(" state: ").append(toIndentedString(state)).append("\n");
619 sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n");
620 sb.append(" completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
621 sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
622 sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
623 sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
624 sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
625 sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n");
626 sb.append(" type: ").append(toIndentedString(type)).append("\n");
627 sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
628 sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
629 sb.append(" orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
630 sb.append(" orderItem: ").append(toIndentedString(orderItem)).append("\n");
631 sb.append(" orderMessage: ").append(toIndentedString(orderMessage)).append("\n");
633 return sb.toString();
637 * Convert the given object to string with each line indented by 4 spaces (except the first
640 private String toIndentedString(java.lang.Object o) {
644 return o.toString().replace("\n", "\n ");