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