3 * Copyright (c) 2017 Orange. All rights reserved.
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
9 * http://www.apache.org/licenses/LICENSE-2.0
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.
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
21 * OpenAPI spec version: 0.1.1_inProgress
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.
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
30 * http://www.apache.org/licenses/LICENSE-2.0
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
39 package org.onap.nbi.apis.serviceorder.model;
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;
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(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
62 date = "2018-02-19T14:00:30.767Z")
65 public class ServiceOrder implements Resource {
69 private String id = null;
72 private String href = null;
74 @JsonProperty("externalId")
75 private String externalId = null;
77 @JsonProperty("priority")
78 private String priority = null;
80 @JsonProperty("description")
81 private String description = null;
83 @JsonProperty("category")
84 private String category = null;
86 @JsonProperty("state")
87 private StateType state = null;
89 @JsonProperty("orderDate")
90 private Date orderDate = null;
92 @JsonProperty("completionDateTime")
93 private Date completionDateTime = null;
95 @JsonProperty("expectedCompletionDate")
96 private Date expectedCompletionDate = null;
98 @JsonProperty("requestedStartDate")
99 private Date requestedStartDate = null;
101 @JsonProperty("requestedCompletionDate")
102 private Date requestedCompletionDate = null;
104 @JsonProperty("startDate")
105 private Date startDate = null;
107 @JsonProperty("@baseType")
108 private String baseType = null;
110 @JsonProperty("@type")
111 private String type = null;
113 @JsonProperty("@schemaLocation")
114 private String schemaLocation = null;
116 @JsonProperty("relatedParty")
117 private List<RelatedParty> relatedParty = null;
119 @JsonProperty("orderRelationship")
120 private List<OrderRelationship> orderRelationship = null;
122 @JsonProperty("orderItem")
123 private List<ServiceOrderItem> orderItem = null;
125 public ServiceOrder id(String id) {
132 * ID created on repository side
138 @ApiModelProperty(required = true, value = "ID created on repository side")
139 public String getId() {
143 public void setId(String id) {
147 public ServiceOrder href(String href) {
153 * Hyperlink to access the order
157 @JsonProperty("href")
158 @ApiModelProperty(value = "Hyperlink to access the order")
159 public String getHref() {
163 public void setHref(String href) {
167 public ServiceOrder externalId(String externalId) {
168 this.externalId = externalId;
173 * ID given by the consumer and only understandable by him (to facilitate his searches)
177 @JsonProperty("externalId")
178 @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
179 public String getExternalId() {
183 public void setExternalId(String externalId) {
184 this.externalId = externalId;
187 public ServiceOrder priority(String priority) {
188 this.priority = priority;
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)
198 @JsonProperty("priority")
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() {
205 public void setPriority(String priority) {
206 this.priority = priority;
209 public ServiceOrder description(String description) {
210 this.description = description;
215 * A free-text description of the service order
217 * @return description
219 @JsonProperty("description")
220 @ApiModelProperty(value = "A free-text description of the service order")
221 public String getDescription() {
225 public void setDescription(String description) {
226 this.description = description;
229 public ServiceOrder category(String category) {
230 this.category = category;
235 * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
240 @JsonProperty("category")
242 value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
243 public String getCategory() {
247 public void setCategory(String category) {
248 this.category = category;
251 public ServiceOrder state(StateType state) {
257 * State of the order : described in the state-machine diagram
261 @JsonProperty("state")
262 @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
263 public StateType getState() {
267 public void setState(StateType state) {
271 public ServiceOrder orderDate(Date orderDate) {
272 this.orderDate = orderDate;
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() {
286 public void setOrderDate(Date orderDate) {
287 this.orderDate = orderDate;
290 public ServiceOrder completionDateTime(Date completionDateTime) {
291 this.completionDateTime = completionDateTime;
296 * Date when the order was completed
298 * @return completionDateTime
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;
307 public void setCompletionDateTime(Date completionDateTime) {
308 this.completionDateTime = completionDateTime;
313 * @return expectedCompletionDate
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;
322 public void setExpectedCompletionDate(Date expectedCompletionDate) {
323 this.expectedCompletionDate = expectedCompletionDate;
326 public ServiceOrder requestedStartDate(Date requestedStartDate) {
327 this.requestedStartDate = requestedStartDate;
332 * Order start date wished by the requestor
334 * @return requestedStartDate
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;
343 public void setRequestedStartDate(Date requestedStartDate) {
344 this.requestedStartDate = requestedStartDate;
347 public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
348 this.requestedCompletionDate = requestedCompletionDate;
353 * Requested delivery date from the requestor perspective
355 * @return requestedCompletionDate
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;
364 public void setRequestedCompletionDate(Date requestedCompletionDate) {
365 this.requestedCompletionDate = requestedCompletionDate;
368 public ServiceOrder startDate(Date startDate) {
369 this.startDate = startDate;
374 * Date when the order was started for processing
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() {
385 public void setStartDate(Date startDate) {
386 this.startDate = startDate;
389 public ServiceOrder baseType(String baseType) {
390 this.baseType = baseType;
397 @JsonProperty("@baseType")
398 @ApiModelProperty(value = "")
399 public String getBaseType() {
403 public void setBaseType(String baseType) {
404 this.baseType = baseType;
407 public ServiceOrder type(String type) {
415 @JsonProperty("@type")
416 @ApiModelProperty(value = "")
417 public String getType() {
421 public void setType(String type) {
425 public ServiceOrder schemaLocation(String schemaLocation) {
426 this.schemaLocation = schemaLocation;
431 * @return schemaLocation
433 @JsonProperty("@schemaLocation")
434 @ApiModelProperty(value = "")
435 public String getSchemaLocation() {
436 return schemaLocation;
439 public void setSchemaLocation(String schemaLocation) {
440 this.schemaLocation = schemaLocation;
443 public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
444 this.relatedParty = relatedParty;
448 public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
449 if (this.relatedParty == null) {
450 this.relatedParty = new ArrayList<RelatedParty>();
452 this.relatedParty.add(relatedPartyItem);
457 * A list of related parties which are involved in this order and the role they are playing.
459 * @return relatedParty
461 @JsonProperty("relatedParty")
463 value = "A list of related parties which are involved in this order and the role they are playing.")
464 public List<RelatedParty> getRelatedParty() {
468 public void setRelatedParty(List<RelatedParty> relatedParty) {
469 this.relatedParty = relatedParty;
472 public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
473 this.orderRelationship = orderRelationship;
477 public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
478 if (this.orderRelationship == null) {
479 this.orderRelationship = new ArrayList<OrderRelationship>();
481 this.orderRelationship.add(orderRelationshipItem);
486 * A list of related order references .Linked order to the one containing this attribute
488 * @return orderRelationship
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;
496 public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
497 this.orderRelationship = orderRelationship;
500 public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
501 this.orderItem = orderItem;
505 public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
506 if (this.orderItem == null) {
507 this.orderItem = new ArrayList<ServiceOrderItem>();
509 this.orderItem.add(orderItemItem);
514 * A list of order items that have to be processed.
518 @JsonProperty("orderItem")
519 @ApiModelProperty(value = "A list of order items that have to be processed.")
521 public List<ServiceOrderItem> getOrderItem() {
525 public void setOrderItem(List<ServiceOrderItem> orderItem) {
526 this.orderItem = orderItem;
531 public boolean equals(java.lang.Object o) {
535 if (o == null || getClass() != o.getClass()) {
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);
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);
567 public String toString() {
568 StringBuilder sb = new StringBuilder();
569 sb.append("class ServiceOrder {\n");
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");
591 return sb.toString();
595 * Convert the given object to string with each line indented by 4 spaces (except the first
598 private String toIndentedString(java.lang.Object o) {
602 return o.toString().replace("\n", "\n ");