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
38 package org.onap.nbi.apis.serviceorder.model;
40 import java.util.ArrayList;
41 import java.util.Date;
42 import java.util.List;
43 import java.util.Objects;
44 import javax.validation.Valid;
45 import javax.validation.constraints.NotNull;
46 import org.hibernate.validator.constraints.NotEmpty;
47 import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
48 import org.onap.nbi.commons.Resource;
49 import org.springframework.data.annotation.Id;
50 import org.springframework.data.mongodb.core.mapping.Document;
51 import com.fasterxml.jackson.annotation.JsonFormat;
52 import com.fasterxml.jackson.annotation.JsonProperty;
53 import io.swagger.annotations.ApiModel;
54 import io.swagger.annotations.ApiModelProperty;
57 * A Service Order is a type of order which can be used to place an order between a customer and a
58 * service provider or between a service provider and a partner and vice versa
61 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")
62 @javax.annotation.Generated(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) {
136 * ID created on repository side
142 @ApiModelProperty(required = true, value = "ID created on repository side")
143 public String getId() {
147 public void setId(String id) {
151 public ServiceOrder href(String href) {
157 * Hyperlink to access the order
161 @JsonProperty("href")
162 @ApiModelProperty(value = "Hyperlink to access the order")
163 public String getHref() {
167 public void setHref(String href) {
171 public ServiceOrder externalId(String externalId) {
172 this.externalId = externalId;
177 * ID given by the consumer and only understandable by him (to facilitate his searches)
181 @JsonProperty("externalId")
182 @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
183 public String getExternalId() {
187 public void setExternalId(String externalId) {
188 this.externalId = externalId;
191 public ServiceOrder priority(String priority) {
192 this.priority = priority;
197 * A way that can be used by consumers to prioritize orders in Service Order Management system
198 * (from 0 to 4 : 0 is the highest priority, and 4 the lowest)
202 @JsonProperty("priority")
204 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)")
205 public String getPriority() {
209 public void setPriority(String priority) {
210 this.priority = priority;
213 public ServiceOrder description(String description) {
214 this.description = description;
219 * A free-text description of the service order
221 * @return description
223 @JsonProperty("description")
224 @ApiModelProperty(value = "A free-text description of the service order")
225 public String getDescription() {
229 public void setDescription(String description) {
230 this.description = description;
233 public ServiceOrder category(String category) {
234 this.category = category;
239 * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
244 @JsonProperty("category")
246 value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
247 public String getCategory() {
251 public void setCategory(String category) {
252 this.category = category;
255 public ServiceOrder state(StateType state) {
261 * State of the order : described in the state-machine diagram
265 @JsonProperty("state")
266 @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
267 public StateType getState() {
271 public void setState(StateType state) {
275 public ServiceOrder orderDate(Date orderDate) {
276 this.orderDate = orderDate;
283 @JsonProperty("orderDate")
284 @ApiModelProperty(value = "")
285 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
286 public Date getOrderDate() {
290 public void setOrderDate(Date orderDate) {
291 this.orderDate = orderDate;
294 public ServiceOrder completionDateTime(Date completionDateTime) {
295 this.completionDateTime = completionDateTime;
300 * Date when the order was completed
302 * @return completionDateTime
304 @JsonProperty("completionDateTime")
305 @ApiModelProperty(value = "Date when the order was completed")
306 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
307 public Date getCompletionDateTime() {
308 return completionDateTime;
311 public void setCompletionDateTime(Date completionDateTime) {
312 this.completionDateTime = completionDateTime;
317 * @return expectedCompletionDate
319 @JsonProperty("expectedCompletionDate")
320 @ApiModelProperty(value = "")
321 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
322 public Date getExpectedCompletionDate() {
323 return expectedCompletionDate;
326 public void setExpectedCompletionDate(Date expectedCompletionDate) {
327 this.expectedCompletionDate = expectedCompletionDate;
330 public ServiceOrder requestedStartDate(Date requestedStartDate) {
331 this.requestedStartDate = requestedStartDate;
336 * Order start date wished by the requestor
338 * @return requestedStartDate
340 @JsonProperty("requestedStartDate")
341 @ApiModelProperty(value = "Order start date wished by the requestor")
342 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
343 public Date getRequestedStartDate() {
344 return requestedStartDate;
347 public void setRequestedStartDate(Date requestedStartDate) {
348 this.requestedStartDate = requestedStartDate;
351 public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
352 this.requestedCompletionDate = requestedCompletionDate;
357 * Requested delivery date from the requestor perspective
359 * @return requestedCompletionDate
361 @JsonProperty("requestedCompletionDate")
362 @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
363 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
364 public Date getRequestedCompletionDate() {
365 return requestedCompletionDate;
368 public void setRequestedCompletionDate(Date requestedCompletionDate) {
369 this.requestedCompletionDate = requestedCompletionDate;
372 public ServiceOrder startDate(Date startDate) {
373 this.startDate = startDate;
378 * Date when the order was started for processing
382 @JsonProperty("startDate")
383 @ApiModelProperty(value = "Date when the order was started for processing")
384 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
385 public Date getStartDate() {
389 public void setStartDate(Date startDate) {
390 this.startDate = startDate;
393 public ServiceOrder baseType(String baseType) {
394 this.baseType = baseType;
401 @JsonProperty("@baseType")
402 @ApiModelProperty(value = "")
403 public String getBaseType() {
407 public void setBaseType(String baseType) {
408 this.baseType = baseType;
411 public ServiceOrder type(String type) {
419 @JsonProperty("@type")
420 @ApiModelProperty(value = "")
421 public String getType() {
425 public void setType(String type) {
429 public ServiceOrder schemaLocation(String schemaLocation) {
430 this.schemaLocation = schemaLocation;
435 * @return schemaLocation
437 @JsonProperty("@schemaLocation")
438 @ApiModelProperty(value = "")
439 public String getSchemaLocation() {
440 return schemaLocation;
443 public void setSchemaLocation(String schemaLocation) {
444 this.schemaLocation = schemaLocation;
447 public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
448 this.relatedParty = relatedParty;
452 public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
453 if (this.relatedParty == null) {
454 this.relatedParty = new ArrayList<RelatedParty>();
456 this.relatedParty.add(relatedPartyItem);
461 * A list of related parties which are involved in this order and the role they are playing.
463 * @return relatedParty
465 @JsonProperty("relatedParty")
467 value = "A list of related parties which are involved in this order and the role they are playing.")
469 public List<RelatedParty> getRelatedParty() {
473 public void setRelatedParty(List<RelatedParty> relatedParty) {
474 this.relatedParty = relatedParty;
477 public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
478 this.orderRelationship = orderRelationship;
482 public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
483 if (this.orderRelationship == null) {
484 this.orderRelationship = new ArrayList<OrderRelationship>();
486 this.orderRelationship.add(orderRelationshipItem);
491 * A list of related order references .Linked order to the one containing this attribute
493 * @return orderRelationship
495 @JsonProperty("orderRelationship")
496 @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
498 public List<OrderRelationship> getOrderRelationship() {
499 return orderRelationship;
502 public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
503 this.orderRelationship = orderRelationship;
506 public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
507 this.orderItem = orderItem;
511 public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
512 if (this.orderItem == null) {
513 this.orderItem = new ArrayList<ServiceOrderItem>();
515 this.orderItem.add(orderItemItem);
520 * A list of order items that have to be processed.
524 @JsonProperty("orderItem")
525 @ApiModelProperty(value = "A list of order items that have to be processed.")
528 public List<ServiceOrderItem> getOrderItem() {
532 public void setOrderItem(List<ServiceOrderItem> orderItem) {
533 this.orderItem = orderItem;
537 public ServiceOrder orderMessage(List<OrderMessage> orderMessage) {
538 this.orderMessage = orderMessage;
542 public ServiceOrder addOrderMessageItem(OrderMessage orderMessageItem) {
543 if (this.orderMessage == null) {
544 this.orderMessage = new ArrayList<OrderMessage>();
546 boolean mesageAlreadyExist=false;
547 for (OrderMessage message : this.orderMessage) {
548 if(message.getCode().equals(orderMessageItem.getCode())){
549 mesageAlreadyExist=true;
553 if(!mesageAlreadyExist) {
554 this.orderMessage.add(orderMessageItem);
561 * @return orderMessage
563 @JsonProperty("orderMessage")
564 @ApiModelProperty(value = "")
566 public List<OrderMessage> getOrderMessage() {
570 public void setOrderMessage(List<OrderMessage> orderMessage) {
571 this.orderMessage = orderMessage;
579 public boolean equals(java.lang.Object o) {
583 if (o == null || getClass() != o.getClass()) {
586 ServiceOrder serviceOrder = (ServiceOrder) o;
587 return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
588 && Objects.equals(this.externalId, serviceOrder.externalId)
589 && Objects.equals(this.priority, serviceOrder.priority)
590 && Objects.equals(this.description, serviceOrder.description)
591 && Objects.equals(this.category, serviceOrder.category)
592 && Objects.equals(this.state, serviceOrder.state)
593 && Objects.equals(this.orderDate, serviceOrder.orderDate)
594 && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
595 && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
596 && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
597 && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
598 && Objects.equals(this.startDate, serviceOrder.startDate)
599 && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
600 && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
601 && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
602 && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
603 && Objects.equals(this.orderItem, serviceOrder.orderItem)
604 && Objects.equals(this.orderMessage, serviceOrder.orderMessage);
609 public int hashCode() {
610 return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
611 expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
612 schemaLocation, relatedParty, orderRelationship, orderItem, orderMessage);
617 public String toString() {
618 StringBuilder sb = new StringBuilder();
619 sb.append("class ServiceOrder {\n");
621 sb.append(" id: ").append(toIndentedString(id)).append("\n");
622 sb.append(" href: ").append(toIndentedString(href)).append("\n");
623 sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n");
624 sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
625 sb.append(" description: ").append(toIndentedString(description)).append("\n");
626 sb.append(" category: ").append(toIndentedString(category)).append("\n");
627 sb.append(" state: ").append(toIndentedString(state)).append("\n");
628 sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n");
629 sb.append(" completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
630 sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
631 sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
632 sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
633 sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
634 sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n");
635 sb.append(" type: ").append(toIndentedString(type)).append("\n");
636 sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
637 sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
638 sb.append(" orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
639 sb.append(" orderItem: ").append(toIndentedString(orderItem)).append("\n");
640 sb.append(" orderMessage: ").append(toIndentedString(orderMessage)).append("\n");
642 return sb.toString();
646 * Convert the given object to string with each line indented by 4 spaces (except the first
649 private String toIndentedString(java.lang.Object o) {
653 return o.toString().replace("\n", "\n ");