305be15334635d54bd35af0b88beda5943765c8b
[externalapi/nbi.git] / src / main / java / org / onap / nbi / apis / serviceorder / model / OrderMessage.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.JsonProperty;
41 import io.swagger.annotations.ApiModel;
42 import io.swagger.annotations.ApiModelProperty;
43 import java.util.Objects;
44 import javax.validation.constraints.NotNull;
45
46 /**
47  * An optional array of messages associated with the Order
48  */
49 @ApiModel(description = "An optional array of messages associated with the Order")
50 @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaJerseyServerCodegen",
51         date = "2018-07-12T11:46:30.345Z")
52 public class OrderMessage {
53
54
55     @JsonProperty("code")
56     private String code = null;
57
58     @JsonProperty("field")
59     private String field = null;
60
61     @JsonProperty("messageInformation")
62     private String messageInformation = null;
63
64     @JsonProperty("severity")
65     private SeverityMessage severity = null;
66
67     @JsonProperty("correctionRequired")
68     private boolean correctionRequired;
69
70
71
72
73     /**
74      * A code associated to this message
75      *
76      * @return code
77      **/
78     @JsonProperty("code")
79     @ApiModelProperty(value = "A code associated to this message")
80     public String getCode() {
81         return code;
82     }
83
84     public void setCode(String code) {
85         this.code = code;
86     }
87
88     public OrderMessage code(String code) {
89         this.code = code;
90         return this;
91     }
92
93
94     /**
95      * Service Order attribute related to this error message
96      *
97      * @return field
98      **/
99     @JsonProperty("field")
100     @ApiModelProperty(value = "Service Order attribute related to this error message")
101     public String getField() {
102         return field;
103     }
104
105     public void setField(String field) {
106         this.field = field;
107     }
108
109     public OrderMessage field(String field) {
110         this.field = field;
111         return this;
112     }
113
114
115     /**
116      * Message related to this order
117      *
118      * @return messageInformation
119      **/
120     @JsonProperty("messageInformation")
121     @ApiModelProperty(value = "Message related to this order")
122     public String getMessageInformation() {
123         return messageInformation;
124     }
125
126     public void setMessageInformation(String messageInformation) {
127         this.messageInformation = messageInformation;
128     }
129
130     public OrderMessage messageInformation(String messageInformation) {
131         this.messageInformation = messageInformation;
132         return this;
133     }
134
135
136     /**
137      * Gravity of this message
138      *
139      * @return severity
140      **/
141     @JsonProperty("severity")
142     @ApiModelProperty(required = true,value = "Gravity of this message")
143     @NotNull(message = "OrderMessage severity cannot be null")
144     public SeverityMessage getSeverity() {
145         return severity;
146     }
147
148     public void setSeverity(SeverityMessage severity) {
149         this.severity = severity;
150     }
151
152     public OrderMessage severity(SeverityMessage severity) {
153         this.severity = severity;
154         return this;
155     }
156
157
158     /**
159      * Indicator that an action is required to allow service order fullfilment to follow up
160      *
161      * @return correctionRequired
162      **/
163     @JsonProperty("correctionRequired")
164     @ApiModelProperty(required = true,value = "Indicator that an action is required to allow service order fullfilment to follow up")
165     @NotNull(message = "OrderMessage correctionRequired cannot be null")
166     public boolean getCorrectionRequired() {
167         return correctionRequired;
168     }
169
170     public void setCorrectionRequired(boolean correctionRequired) {
171         this.correctionRequired = correctionRequired;
172     }
173
174     public OrderMessage severity(boolean correctionRequired) {
175         this.correctionRequired = correctionRequired;
176         return this;
177     }
178
179
180     @Override
181     public boolean equals(Object o) {
182         if (this == o) {
183             return true;
184         }
185         if (o == null || getClass() != o.getClass()) {
186             return false;
187         }
188         OrderMessage orderMessage = (OrderMessage) o;
189         return Objects.equals(this.code, orderMessage.code)
190             && Objects.equals(this.field, orderMessage.field)
191             && Objects.equals(this.messageInformation, orderMessage.messageInformation)
192             && Objects.equals(this.severity, orderMessage.severity)
193             && Objects.equals(this.correctionRequired, orderMessage.correctionRequired);
194     }
195
196
197     @Override
198     public int hashCode() {
199         return Objects.hash(code, field, messageInformation,severity);
200     }
201
202
203     @Override
204     public String toString() {
205         StringBuilder sb = new StringBuilder();
206         sb.append("class OrderMessage {\n");
207         sb.append(" code: ").append(toIndentedString(code)).append("\n");
208         sb.append(" field: ").append(toIndentedString(field)).append("\n");
209         sb.append(" messageInformation: ").append(toIndentedString(messageInformation)).append("\n");
210         sb.append(" severity: ").append(toIndentedString(severity)).append("\n");
211         sb.append(" correctionRequired: ").append(toIndentedString(correctionRequired)).append("\n");
212         sb.append("}");
213         return sb.toString();
214     }
215
216     /**
217      * Convert the given object to string with each line indented by 4 spaces (except the first
218      * line).
219      */
220     private String toIndentedString(Object o) {
221         if (o == null) {
222             return "null";
223         }
224         return o.toString().replace("\n", "\n    ");
225     }
226 }
227