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 org.hibernate.validator.constraints.NotEmpty;
45 import org.onap.nbi.apis.serviceorder.serviceordervalidator.ValidServiceOrder;
46 import org.onap.nbi.commons.Resource;
47 import org.springframework.data.annotation.Id;
48 import org.springframework.data.mongodb.core.mapping.Document;
49 import com.fasterxml.jackson.annotation.JsonFormat;
50 import com.fasterxml.jackson.annotation.JsonProperty;
51 import io.swagger.annotations.ApiModel;
52 import io.swagger.annotations.ApiModelProperty;
55 * A Service Order is a type of order which can be used to place an order between a customer and a
56 * service provider or between a service provider and a partner and vice versa
59 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")
60 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
61 date = "2018-02-19T14:00:30.767Z")
64 public class ServiceOrder implements Resource {
68 private String id = null;
71 private String href = null;
73 @JsonProperty("externalId")
74 private String externalId = null;
76 @JsonProperty("priority")
77 private String priority = null;
79 @JsonProperty("description")
80 private String description = null;
82 @JsonProperty("category")
83 private String category = null;
85 @JsonProperty("state")
86 private StateType state = null;
88 @JsonProperty("orderDate")
89 private Date orderDate = null;
91 @JsonProperty("completionDateTime")
92 private Date completionDateTime = null;
94 @JsonProperty("expectedCompletionDate")
95 private Date expectedCompletionDate = null;
97 @JsonProperty("requestedStartDate")
98 private Date requestedStartDate = null;
100 @JsonProperty("requestedCompletionDate")
101 private Date requestedCompletionDate = null;
103 @JsonProperty("startDate")
104 private Date startDate = null;
106 @JsonProperty("@baseType")
107 private String baseType = null;
109 @JsonProperty("@type")
110 private String type = null;
112 @JsonProperty("@schemaLocation")
113 private String schemaLocation = null;
115 @JsonProperty("relatedParty")
116 private List<RelatedParty> relatedParty = null;
118 @JsonProperty("orderRelationship")
119 private List<OrderRelationship> orderRelationship = null;
121 @JsonProperty("orderItem")
122 private List<ServiceOrderItem> orderItem = null;
124 public ServiceOrder id(String id) {
131 * ID created on repository side
137 @ApiModelProperty(required = true, value = "ID created on repository side")
138 public String getId() {
142 public void setId(String id) {
146 public ServiceOrder href(String href) {
152 * Hyperlink to access the order
156 @JsonProperty("href")
157 @ApiModelProperty(value = "Hyperlink to access the order")
158 public String getHref() {
162 public void setHref(String href) {
166 public ServiceOrder externalId(String externalId) {
167 this.externalId = externalId;
172 * ID given by the consumer and only understandable by him (to facilitate his searches)
176 @JsonProperty("externalId")
177 @ApiModelProperty(value = "ID given by the consumer and only understandable by him (to facilitate his searches)")
178 public String getExternalId() {
182 public void setExternalId(String externalId) {
183 this.externalId = externalId;
186 public ServiceOrder priority(String priority) {
187 this.priority = priority;
192 * A way that can be used by consumers to prioritize orders in Service Order Management system
193 * (from 0 to 4 : 0 is the highest priority, and 4 the lowest)
197 @JsonProperty("priority")
199 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)")
200 public String getPriority() {
204 public void setPriority(String priority) {
205 this.priority = priority;
208 public ServiceOrder description(String description) {
209 this.description = description;
214 * A free-text description of the service order
216 * @return description
218 @JsonProperty("description")
219 @ApiModelProperty(value = "A free-text description of the service order")
220 public String getDescription() {
224 public void setDescription(String description) {
225 this.description = description;
228 public ServiceOrder category(String category) {
229 this.category = category;
234 * Used to categorize the order that can be useful for the OM system (e.g. “broadband”,
239 @JsonProperty("category")
241 value = "Used to categorize the order that can be useful for the OM system (e.g. “broadband”, “TVOption”, ...)")
242 public String getCategory() {
246 public void setCategory(String category) {
247 this.category = category;
250 public ServiceOrder state(StateType state) {
256 * State of the order : described in the state-machine diagram
260 @JsonProperty("state")
261 @ApiModelProperty(value = "State of the order : described in the state-machine diagram")
262 public StateType getState() {
266 public void setState(StateType state) {
270 public ServiceOrder orderDate(Date orderDate) {
271 this.orderDate = orderDate;
278 @JsonProperty("orderDate")
279 @ApiModelProperty(value = "")
280 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
281 public Date getOrderDate() {
285 public void setOrderDate(Date orderDate) {
286 this.orderDate = orderDate;
289 public ServiceOrder completionDateTime(Date completionDateTime) {
290 this.completionDateTime = completionDateTime;
295 * Date when the order was completed
297 * @return completionDateTime
299 @JsonProperty("completionDateTime")
300 @ApiModelProperty(value = "Date when the order was completed")
301 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
302 public Date getCompletionDateTime() {
303 return completionDateTime;
306 public void setCompletionDateTime(Date completionDateTime) {
307 this.completionDateTime = completionDateTime;
312 * @return expectedCompletionDate
314 @JsonProperty("expectedCompletionDate")
315 @ApiModelProperty(value = "")
316 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
317 public Date getExpectedCompletionDate() {
318 return expectedCompletionDate;
321 public void setExpectedCompletionDate(Date expectedCompletionDate) {
322 this.expectedCompletionDate = expectedCompletionDate;
325 public ServiceOrder requestedStartDate(Date requestedStartDate) {
326 this.requestedStartDate = requestedStartDate;
331 * Order start date wished by the requestor
333 * @return requestedStartDate
335 @JsonProperty("requestedStartDate")
336 @ApiModelProperty(value = "Order start date wished by the requestor")
337 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
338 public Date getRequestedStartDate() {
339 return requestedStartDate;
342 public void setRequestedStartDate(Date requestedStartDate) {
343 this.requestedStartDate = requestedStartDate;
346 public ServiceOrder requestedCompletionDate(Date requestedCompletionDate) {
347 this.requestedCompletionDate = requestedCompletionDate;
352 * Requested delivery date from the requestor perspective
354 * @return requestedCompletionDate
356 @JsonProperty("requestedCompletionDate")
357 @ApiModelProperty(value = "Requested delivery date from the requestor perspective")
358 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
359 public Date getRequestedCompletionDate() {
360 return requestedCompletionDate;
363 public void setRequestedCompletionDate(Date requestedCompletionDate) {
364 this.requestedCompletionDate = requestedCompletionDate;
367 public ServiceOrder startDate(Date startDate) {
368 this.startDate = startDate;
373 * Date when the order was started for processing
377 @JsonProperty("startDate")
378 @ApiModelProperty(value = "Date when the order was started for processing")
379 @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
380 public Date getStartDate() {
384 public void setStartDate(Date startDate) {
385 this.startDate = startDate;
388 public ServiceOrder baseType(String baseType) {
389 this.baseType = baseType;
396 @JsonProperty("@baseType")
397 @ApiModelProperty(value = "")
398 public String getBaseType() {
402 public void setBaseType(String baseType) {
403 this.baseType = baseType;
406 public ServiceOrder type(String type) {
414 @JsonProperty("@type")
415 @ApiModelProperty(value = "")
416 public String getType() {
420 public void setType(String type) {
424 public ServiceOrder schemaLocation(String schemaLocation) {
425 this.schemaLocation = schemaLocation;
430 * @return schemaLocation
432 @JsonProperty("@schemaLocation")
433 @ApiModelProperty(value = "")
434 public String getSchemaLocation() {
435 return schemaLocation;
438 public void setSchemaLocation(String schemaLocation) {
439 this.schemaLocation = schemaLocation;
442 public ServiceOrder relatedParty(List<RelatedParty> relatedParty) {
443 this.relatedParty = relatedParty;
447 public ServiceOrder addRelatedPartyItem(RelatedParty relatedPartyItem) {
448 if (this.relatedParty == null) {
449 this.relatedParty = new ArrayList<RelatedParty>();
451 this.relatedParty.add(relatedPartyItem);
456 * A list of related parties which are involved in this order and the role they are playing.
458 * @return relatedParty
460 @JsonProperty("relatedParty")
462 value = "A list of related parties which are involved in this order and the role they are playing.")
463 public List<RelatedParty> getRelatedParty() {
467 public void setRelatedParty(List<RelatedParty> relatedParty) {
468 this.relatedParty = relatedParty;
471 public ServiceOrder orderRelationship(List<OrderRelationship> orderRelationship) {
472 this.orderRelationship = orderRelationship;
476 public ServiceOrder addOrderRelationshipItem(OrderRelationship orderRelationshipItem) {
477 if (this.orderRelationship == null) {
478 this.orderRelationship = new ArrayList<OrderRelationship>();
480 this.orderRelationship.add(orderRelationshipItem);
485 * A list of related order references .Linked order to the one containing this attribute
487 * @return orderRelationship
489 @JsonProperty("orderRelationship")
490 @ApiModelProperty(value = "A list of related order references .Linked order to the one containing this attribute")
491 public List<OrderRelationship> getOrderRelationship() {
492 return orderRelationship;
495 public void setOrderRelationship(List<OrderRelationship> orderRelationship) {
496 this.orderRelationship = orderRelationship;
499 public ServiceOrder orderItem(List<ServiceOrderItem> orderItem) {
500 this.orderItem = orderItem;
504 public ServiceOrder addOrderItemItem(ServiceOrderItem orderItemItem) {
505 if (this.orderItem == null) {
506 this.orderItem = new ArrayList<ServiceOrderItem>();
508 this.orderItem.add(orderItemItem);
513 * A list of order items that have to be processed.
517 @JsonProperty("orderItem")
518 @ApiModelProperty(value = "A list of order items that have to be processed.")
520 public List<ServiceOrderItem> getOrderItem() {
524 public void setOrderItem(List<ServiceOrderItem> orderItem) {
525 this.orderItem = orderItem;
530 public boolean equals(java.lang.Object o) {
534 if (o == null || getClass() != o.getClass()) {
537 ServiceOrder serviceOrder = (ServiceOrder) o;
538 return Objects.equals(this.id, serviceOrder.id) && Objects.equals(this.href, serviceOrder.href)
539 && Objects.equals(this.externalId, serviceOrder.externalId)
540 && Objects.equals(this.priority, serviceOrder.priority)
541 && Objects.equals(this.description, serviceOrder.description)
542 && Objects.equals(this.category, serviceOrder.category)
543 && Objects.equals(this.state, serviceOrder.state)
544 && Objects.equals(this.orderDate, serviceOrder.orderDate)
545 && Objects.equals(this.completionDateTime, serviceOrder.completionDateTime)
546 && Objects.equals(this.expectedCompletionDate, serviceOrder.expectedCompletionDate)
547 && Objects.equals(this.requestedStartDate, serviceOrder.requestedStartDate)
548 && Objects.equals(this.requestedCompletionDate, serviceOrder.requestedCompletionDate)
549 && Objects.equals(this.startDate, serviceOrder.startDate)
550 && Objects.equals(this.baseType, serviceOrder.baseType) && Objects.equals(this.type, serviceOrder.type)
551 && Objects.equals(this.schemaLocation, serviceOrder.schemaLocation)
552 && Objects.equals(this.relatedParty, serviceOrder.relatedParty)
553 && Objects.equals(this.orderRelationship, serviceOrder.orderRelationship)
554 && Objects.equals(this.orderItem, serviceOrder.orderItem);
558 public int hashCode() {
559 return Objects.hash(id, href, externalId, priority, description, category, state, orderDate, completionDateTime,
560 expectedCompletionDate, requestedStartDate, requestedCompletionDate, startDate, baseType, type,
561 schemaLocation, relatedParty, orderRelationship, orderItem);
566 public String toString() {
567 StringBuilder sb = new StringBuilder();
568 sb.append("class ServiceOrder {\n");
570 sb.append(" id: ").append(toIndentedString(id)).append("\n");
571 sb.append(" href: ").append(toIndentedString(href)).append("\n");
572 sb.append(" externalId: ").append(toIndentedString(externalId)).append("\n");
573 sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
574 sb.append(" description: ").append(toIndentedString(description)).append("\n");
575 sb.append(" category: ").append(toIndentedString(category)).append("\n");
576 sb.append(" state: ").append(toIndentedString(state)).append("\n");
577 sb.append(" orderDate: ").append(toIndentedString(orderDate)).append("\n");
578 sb.append(" completionDateTime: ").append(toIndentedString(completionDateTime)).append("\n");
579 sb.append(" expectedCompletionDate: ").append(toIndentedString(expectedCompletionDate)).append("\n");
580 sb.append(" requestedStartDate: ").append(toIndentedString(requestedStartDate)).append("\n");
581 sb.append(" requestedCompletionDate: ").append(toIndentedString(requestedCompletionDate)).append("\n");
582 sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n");
583 sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n");
584 sb.append(" type: ").append(toIndentedString(type)).append("\n");
585 sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
586 sb.append(" relatedParty: ").append(toIndentedString(relatedParty)).append("\n");
587 sb.append(" orderRelationship: ").append(toIndentedString(orderRelationship)).append("\n");
588 sb.append(" orderItem: ").append(toIndentedString(orderItem)).append("\n");
590 return sb.toString();
594 * Convert the given object to string with each line indented by 4 spaces (except the first
597 private String toIndentedString(java.lang.Object o) {
601 return o.toString().replace("\n", "\n ");