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 com.fasterxml.jackson.annotation.JsonIgnore;
41 import com.fasterxml.jackson.annotation.JsonProperty;
42 import io.swagger.annotations.ApiModel;
43 import io.swagger.annotations.ApiModelProperty;
44 import javax.validation.constraints.NotNull;
45 import java.util.ArrayList;
46 import java.util.List;
47 import java.util.Objects;
50 * An identified part of the order. A service order is decomposed into one or more order items.
52 @ApiModel(description = "An identified part of the order. A service order is decomposed into one or more order items.")
53 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
54 date = "2018-02-19T14:00:30.767Z")
55 public class ServiceOrderItem {
57 private String id = null;
59 @JsonProperty("action")
60 private ActionType action = null;
62 @JsonProperty("state")
63 private StateType state = null;
65 @JsonProperty("percentProgress")
66 private String percentProgress = null;
68 @JsonProperty("@type")
69 private String type = null;
71 @JsonProperty("@schemaLocation")
72 private String schemaLocation = null;
74 @JsonProperty("@baseType")
75 private String baseType = null;
78 private String requestId;
80 @JsonProperty("orderItemRelationship")
81 private List<OrderItemRelationship> orderItemRelationship = new ArrayList<>();
83 @JsonProperty("service")
84 private Service service = null;
87 @JsonProperty("orderMessage")
88 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(required = true,
103 value = "Identifier of the line item (generally it is a sequence number 01, 02, 03, …)")
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")
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")
246 public List<OrderItemRelationship> getOrderItemRelationship() {
247 return orderItemRelationship;
250 public void setOrderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
251 this.orderItemRelationship = orderItemRelationship;
254 public ServiceOrderItem service(Service service) {
255 this.service = service;
260 * The Service to be acted on by the order item
264 @JsonProperty("service")
265 @ApiModelProperty(required = true, value = "The Service to be acted on by the order item")
267 public Service getService() {
271 public void setService(Service service) {
272 this.service = service;
276 public String getRequestId() {
280 public void setRequestId(String requestId) {
281 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 = "")
313 public List<OrderMessage> getOrderItemMessage() {
314 return orderItemMessage;
317 public void setOrderMessage(List<OrderMessage> orderItemMessage) {
318 this.orderItemMessage = orderItemMessage;
325 public boolean equals(java.lang.Object o) {
329 if (o == null || getClass() != o.getClass()) {
332 ServiceOrderItem serviceOrderItem = (ServiceOrderItem) o;
333 return Objects.equals(this.id, serviceOrderItem.id) && Objects.equals(this.action, serviceOrderItem.action)
334 && Objects.equals(this.state, serviceOrderItem.state)
335 && Objects.equals(this.percentProgress, serviceOrderItem.percentProgress)
336 && Objects.equals(this.type, serviceOrderItem.type)
337 && Objects.equals(this.schemaLocation, serviceOrderItem.schemaLocation)
338 && Objects.equals(this.baseType, serviceOrderItem.baseType)
339 && Objects.equals(this.orderItemRelationship, serviceOrderItem.orderItemRelationship)
340 && Objects.equals(this.service, serviceOrderItem.service)
341 && Objects.equals(this.requestId, serviceOrderItem.requestId)
342 && Objects.equals(this.orderItemMessage, serviceOrderItem.orderItemMessage);
347 public int hashCode() {
348 return Objects.hash(id, action, state, percentProgress, type, schemaLocation, baseType, orderItemRelationship, service,
349 requestId,orderItemMessage);
354 public String toString() {
355 StringBuilder sb = new StringBuilder();
356 sb.append("class ServiceOrderItem {\n");
357 sb.append(" id: ").append(toIndentedString(id)).append("\n");
358 sb.append(" action: ").append(toIndentedString(action)).append("\n");
359 sb.append(" state: ").append(toIndentedString(state)).append("\n");
360 sb.append(" percentProgress: ").append(toIndentedString(percentProgress)).append("\n");
361 sb.append(" type: ").append(toIndentedString(type)).append("\n");
362 sb.append(" schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
363 sb.append(" baseType: ").append(toIndentedString(baseType)).append("\n");
364 sb.append(" orderItemRelationship: ").append(toIndentedString(orderItemRelationship)).append("\n");
365 sb.append(" requestId: ").append(toIndentedString(requestId)).append("\n");
366 sb.append(" service: ").append(toIndentedString(service)).append("\n");
367 sb.append(" service: ").append(toIndentedString(orderItemMessage)).append("\n");
369 return sb.toString();
373 * Convert the given object to string with each line indented by 4 spaces (except the first
376 private String toIndentedString(java.lang.Object o) {
380 return o.toString().replace("\n", "\n ");