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 com.fasterxml.jackson.annotation.JsonIgnore;
40 import com.fasterxml.jackson.annotation.JsonProperty;
41 import io.swagger.annotations.ApiModel;
42 import io.swagger.annotations.ApiModelProperty;
43 import java.util.ArrayList;
44 import java.util.List;
45 import java.util.Objects;
46 import javax.validation.Valid;
47 import javax.validation.constraints.NotNull;
48 import javax.validation.constraints.Pattern;
51 * An identified part of the order. A service order is decomposed into one or more order items.
53 @ApiModel(description = "An identified part of the order. A service order is decomposed into one or more order items.")
54 @javax.annotation.Generated(
55 value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
56 date = "2018-02-19T14:00:30.767Z")
57 public class ServiceOrderItem {
59 private String id = null;
61 @JsonProperty("action")
62 private ActionType action = null;
64 @JsonProperty("state")
65 private StateType state = null;
67 @JsonProperty("percentProgress")
68 private String percentProgress = "0";
70 @JsonProperty("@type")
71 private String type = null;
73 @JsonProperty("@schemaLocation")
74 private String schemaLocation = null;
76 @JsonProperty("@baseType")
77 private String baseType = null;
80 private String requestId;
82 @JsonProperty("orderItemRelationship")
83 private List<OrderItemRelationship> orderItemRelationship = new ArrayList<>();
85 @JsonProperty("service")
86 private Service service = null;
88 @JsonProperty("orderMessage")
89 private List<OrderMessage> orderItemMessage = new ArrayList<>();
91 public ServiceOrderItem id(String id) {
97 * Identifier of the line item (generally it is a sequence number 01, 02, 03, …)
102 @ApiModelProperty(value = "Identifier of the line item (generally it is a sequence number 01, 02, 03, …)")
103 @NotNull(message = "order item id cannot be null")
104 @Pattern(regexp = "^(?!\\s*$).+", message = "order item id cannot be empty")
105 public String getId() {
109 public void setId(String id) {
113 public ServiceOrderItem action(ActionType action) {
114 this.action = action;
119 * The action to be carried out on the Service. Can be add, modify, delete, noChange
123 @JsonProperty("action")
124 @ApiModelProperty(value = "The action to be carried out on the Service. Can be add, modify, delete, noChange")
125 public ActionType getAction() {
129 public void setAction(ActionType action) {
130 this.action = action;
133 public ServiceOrderItem state(StateType state) {
139 * State of the order item (described in the state machine diagram)
143 @JsonProperty("state")
144 @ApiModelProperty(value = "State of the order item (described in the state machine diagram)")
145 public StateType getState() {
149 public void setState(StateType state) {
153 public ServiceOrderItem type(String type) {
159 * Progress of the delivery in percentage
161 * @return percentProgress
163 @JsonProperty("percentProgress")
164 @ApiModelProperty(required = false, value = "Progress of the delivery in percentage")
165 @NotNull(message = "order item PercentProgress cannot be null")
166 public String getPercentProgress() {
167 return percentProgress;
170 public void setPercentProgress(String percentProgress) {
171 this.percentProgress = percentProgress;
178 @JsonProperty("@type")
179 @ApiModelProperty(value = "")
180 public String getType() {
184 public void setType(String type) {
188 public ServiceOrderItem schemaLocation(String schemaLocation) {
189 this.schemaLocation = schemaLocation;
195 * @return schemaLocation
197 @JsonProperty("@schemaLocation")
198 @ApiModelProperty(value = "")
199 public String getSchemaLocation() {
200 return schemaLocation;
203 public void setSchemaLocation(String schemaLocation) {
204 this.schemaLocation = schemaLocation;
207 public ServiceOrderItem baseType(String baseType) {
208 this.baseType = baseType;
216 @JsonProperty("@baseType")
217 @ApiModelProperty(value = "")
218 public String getBaseType() {
222 public void setBaseType(String baseType) {
223 this.baseType = baseType;
226 public ServiceOrderItem orderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
227 this.orderItemRelationship = orderItemRelationship;
231 public ServiceOrderItem addOrderItemRelationshipItem(OrderItemRelationship orderItemRelationshipItem) {
232 if (this.orderItemRelationship == null) {
233 this.orderItemRelationship = new ArrayList<OrderItemRelationship>();
235 this.orderItemRelationship.add(orderItemRelationshipItem);
240 * Linked order item to the one containing this attribute
242 * @return orderItemRelationship
244 @JsonProperty("orderItemRelationship")
245 @ApiModelProperty(value = "Linked order item to the one containing this attribute")
247 public List<OrderItemRelationship> getOrderItemRelationship() {
248 return orderItemRelationship;
251 public void setOrderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
252 this.orderItemRelationship = orderItemRelationship;
255 public ServiceOrderItem service(Service service) {
256 this.service = service;
261 * The Service to be acted on by the order item
265 @JsonProperty("service")
266 @ApiModelProperty(required = true, value = "The Service to be acted on by the order item")
267 @NotNull(message = "order item service cannot be null")
269 public Service getService() {
273 public void setService(Service service) {
274 this.service = service;
277 public String getRequestId() {
281 public void setRequestId(String requestId) {
282 this.requestId = requestId;
285 public ServiceOrderItem orderItemMessage(List<OrderMessage> orderItemMessage) {
286 this.orderItemMessage = orderItemMessage;
290 public ServiceOrderItem addOrderItemMessageItem(OrderMessage orderItemMessageItem) {
291 if (this.orderItemMessage == null) {
292 this.orderItemMessage = new ArrayList<OrderMessage>();
294 boolean mesageAlreadyExist = false;
295 for (OrderMessage message : this.orderItemMessage) {
296 if (message.getCode().equals(orderItemMessageItem.getCode())) {
297 mesageAlreadyExist = true;
301 if (!mesageAlreadyExist) {
302 this.orderItemMessage.add(orderItemMessageItem);
309 * @return orderItemMessage
311 @JsonProperty("orderItemMessage")
312 @ApiModelProperty(value = "")
314 public List<OrderMessage> getOrderItemMessage() {
315 return orderItemMessage;
318 public void setOrderMessage(List<OrderMessage> orderItemMessage) {
319 this.orderItemMessage = orderItemMessage;
323 public boolean equals(java.lang.Object o) {
327 if (o == null || getClass() != o.getClass()) {
330 ServiceOrderItem serviceOrderItem = (ServiceOrderItem) o;
331 return Objects.equals(this.id, serviceOrderItem.id) && Objects.equals(this.action, serviceOrderItem.action)
332 && Objects.equals(this.state, serviceOrderItem.state)
333 && Objects.equals(this.percentProgress, serviceOrderItem.percentProgress)
334 && Objects.equals(this.type, serviceOrderItem.type)
335 && Objects.equals(this.schemaLocation, serviceOrderItem.schemaLocation)
336 && Objects.equals(this.baseType, serviceOrderItem.baseType)
337 && Objects.equals(this.orderItemRelationship, serviceOrderItem.orderItemRelationship)
338 && Objects.equals(this.service, serviceOrderItem.service)
339 && Objects.equals(this.requestId, serviceOrderItem.requestId)
340 && Objects.equals(this.orderItemMessage, serviceOrderItem.orderItemMessage);
345 public int hashCode() {
346 return Objects.hash(id, action, state, percentProgress, type, schemaLocation, baseType, orderItemRelationship,
347 service, requestId, orderItemMessage);
351 public String toString() {
352 StringBuilder sb = new StringBuilder();
353 sb.append("class ServiceOrderItem {\n");
354 sb.append(" id: ").append(toIndentedString(id)).append("\n");
355 sb.append(" action: ").append(toIndentedString(action)).append("\n");
356 sb.append(" state: ").append(toIndentedString(state)).append("\n");
357 sb.append(" percentProgress: ").append(toIndentedString(percentProgress)).append("\n");
358 sb.append(" type: ").append(toIndentedString(type)).append("\n");
359 sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
360 sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n");
361 sb.append(" orderItemRelationship: ").append(toIndentedString(orderItemRelationship)).append("\n");
362 sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
363 sb.append(" service: ").append(toIndentedString(service)).append("\n");
364 sb.append(" service: ").append(toIndentedString(orderItemMessage)).append("\n");
366 return sb.toString();
370 * Convert the given object to string with each line indented by 4 spaces (except the first
373 private String toIndentedString(java.lang.Object o) {
377 return o.toString().replace("\n", "\n ");