Remove 'All rights reserved.' on apache 2 license
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / ServiceOrderItem.java
1 /**
2  *     Copyright (c) 2018 Orange
3  *
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
7  *
8  *         http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 /*
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
19  *
20  * OpenAPI spec version: 0.1.1_inProgress
21  * 
22  *
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.
25  *
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
28  *
29  * http://www.apache.org/licenses/LICENSE-2.0
30  *
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
34  * the License.
35  */
36
37
38 package org.onap.nbi.apis.serviceorder.model;
39
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;
48
49 /**
50  * An identified part of the order. A service order is decomposed into one or more order items.
51  */
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 {
56     @JsonProperty("id")
57     private String id = null;
58
59     @JsonProperty("action")
60     private ActionType action = null;
61
62     @JsonProperty("state")
63     private StateType state = null;
64
65     @JsonProperty("@type")
66     private String type = null;
67
68     @JsonProperty("@schemaLocation")
69     private String schemaLocation = null;
70
71     @JsonProperty("@baseType")
72     private String baseType = null;
73
74     @JsonIgnore
75     private String requestId;
76
77     @JsonProperty("orderItemRelationship")
78     private List<OrderItemRelationship> orderItemRelationship = new ArrayList<>();
79
80     @JsonProperty("service")
81     private Service service = null;
82
83     public ServiceOrderItem id(String id) {
84         this.id = id;
85         return this;
86     }
87
88     /**
89      * Identifier of the line item (generally it is a sequence number 01, 02, 03, …)
90      * 
91      * @return id
92      **/
93     @JsonProperty("id")
94     @ApiModelProperty(required = true,
95             value = "Identifier of the line item (generally it is a sequence number 01, 02, 03, …)")
96     @NotNull
97     public String getId() {
98         return id;
99     }
100
101     public void setId(String id) {
102         this.id = id;
103     }
104
105     public ServiceOrderItem action(ActionType action) {
106         this.action = action;
107         return this;
108     }
109
110     /**
111      * The action to be carried out on the Service. Can be add, modify, delete, noChange
112      * 
113      * @return action
114      **/
115     @JsonProperty("action")
116     @ApiModelProperty(value = "The action to be carried out on the Service. Can be add, modify, delete, noChange")
117     public ActionType getAction() {
118         return action;
119     }
120
121     public void setAction(ActionType action) {
122         this.action = action;
123     }
124
125     public ServiceOrderItem state(StateType state) {
126         this.state = state;
127         return this;
128     }
129
130     /**
131      * State of the order item (described in the state machine diagram)
132      * 
133      * @return state
134      **/
135     @JsonProperty("state")
136     @ApiModelProperty(value = "State of the order item (described in the state machine diagram)")
137     public StateType getState() {
138         return state;
139     }
140
141     public void setState(StateType state) {
142         this.state = state;
143     }
144
145     public ServiceOrderItem type(String type) {
146         this.type = type;
147         return this;
148     }
149
150     /**
151      * 
152      * @return type
153      **/
154     @JsonProperty("@type")
155     @ApiModelProperty(value = "")
156     public String getType() {
157         return type;
158     }
159
160     public void setType(String type) {
161         this.type = type;
162     }
163
164     public ServiceOrderItem schemaLocation(String schemaLocation) {
165         this.schemaLocation = schemaLocation;
166         return this;
167     }
168
169     /**
170      * 
171      * @return schemaLocation
172      **/
173     @JsonProperty("@schemaLocation")
174     @ApiModelProperty(value = "")
175     public String getSchemaLocation() {
176         return schemaLocation;
177     }
178
179     public void setSchemaLocation(String schemaLocation) {
180         this.schemaLocation = schemaLocation;
181     }
182
183     public ServiceOrderItem baseType(String baseType) {
184         this.baseType = baseType;
185         return this;
186     }
187
188     /**
189      * 
190      * @return baseType
191      **/
192     @JsonProperty("@baseType")
193     @ApiModelProperty(value = "")
194     public String getBaseType() {
195         return baseType;
196     }
197
198     public void setBaseType(String baseType) {
199         this.baseType = baseType;
200     }
201
202     public ServiceOrderItem orderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
203         this.orderItemRelationship = orderItemRelationship;
204         return this;
205     }
206
207     public ServiceOrderItem addOrderItemRelationshipItem(OrderItemRelationship orderItemRelationshipItem) {
208         if (this.orderItemRelationship == null) {
209             this.orderItemRelationship = new ArrayList<OrderItemRelationship>();
210         }
211         this.orderItemRelationship.add(orderItemRelationshipItem);
212         return this;
213     }
214
215     /**
216      * Linked order item to the one containing this attribute
217      * 
218      * @return orderItemRelationship
219      **/
220     @JsonProperty("orderItemRelationship")
221     @ApiModelProperty(value = "Linked order item to the one containing this attribute")
222     public List<OrderItemRelationship> getOrderItemRelationship() {
223         return orderItemRelationship;
224     }
225
226     public void setOrderItemRelationship(List<OrderItemRelationship> orderItemRelationship) {
227         this.orderItemRelationship = orderItemRelationship;
228     }
229
230     public ServiceOrderItem service(Service service) {
231         this.service = service;
232         return this;
233     }
234
235     /**
236      * The Service to be acted on by the order item
237      * 
238      * @return service
239      **/
240     @JsonProperty("service")
241     @ApiModelProperty(required = true, value = "The Service to be acted on by the order item")
242     @NotNull
243     public Service getService() {
244         return service;
245     }
246
247     public void setService(Service service) {
248         this.service = service;
249     }
250
251
252     public String getRequestId() {
253         return requestId;
254     }
255
256     public void setRequestId(String requestId) {
257         this.requestId = requestId;
258     }
259
260     @Override
261     public boolean equals(java.lang.Object o) {
262         if (this == o) {
263             return true;
264         }
265         if (o == null || getClass() != o.getClass()) {
266             return false;
267         }
268         ServiceOrderItem serviceOrderItem = (ServiceOrderItem) o;
269         return Objects.equals(this.id, serviceOrderItem.id) && Objects.equals(this.action, serviceOrderItem.action)
270                 && Objects.equals(this.state, serviceOrderItem.state)
271                 && Objects.equals(this.type, serviceOrderItem.type)
272                 && Objects.equals(this.schemaLocation, serviceOrderItem.schemaLocation)
273                 && Objects.equals(this.baseType, serviceOrderItem.baseType)
274                 && Objects.equals(this.orderItemRelationship, serviceOrderItem.orderItemRelationship)
275                 && Objects.equals(this.service, serviceOrderItem.service)
276                 && Objects.equals(this.requestId, serviceOrderItem.requestId);
277     }
278
279     @Override
280     public int hashCode() {
281         return Objects.hash(id, action, state, type, schemaLocation, baseType, orderItemRelationship, service,
282                 requestId);
283     }
284
285
286     @Override
287     public String toString() {
288         StringBuilder sb = new StringBuilder();
289         sb.append("class ServiceOrderItem {\n");
290
291         sb.append("    id: ").append(toIndentedString(id)).append("\n");
292         sb.append("    action: ").append(toIndentedString(action)).append("\n");
293         sb.append("    state: ").append(toIndentedString(state)).append("\n");
294         sb.append("    type: ").append(toIndentedString(type)).append("\n");
295         sb.append("    schemaLocation: ").append(toIndentedString(schemaLocation)).append("\n");
296         sb.append("    baseType: ").append(toIndentedString(baseType)).append("\n");
297         sb.append("    orderItemRelationship: ").append(toIndentedString(orderItemRelationship)).append("\n");
298         sb.append("    requestId: ").append(toIndentedString(requestId)).append("\n");
299         sb.append("    service: ").append(toIndentedString(service)).append("\n");
300         sb.append("}");
301         return sb.toString();
302     }
303
304     /**
305      * Convert the given object to string with each line indented by 4 spaces (except the first
306      * line).
307      */
308     private String toIndentedString(java.lang.Object o) {
309         if (o == null) {
310             return "null";
311         }
312         return o.toString().replace("\n", "\n    ");
313     }
314 }
315