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