Merge "[AAI] Fix doc config files"
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / prevalidation / Violation.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2018-19 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.aai.prevalidation;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import java.util.Objects;
26
27 public class Violation {
28
29     @SerializedName("violationId")
30     private String violationId;
31
32     @SerializedName("modelName")
33     private String modelName;
34
35     @SerializedName("category")
36     private String category;
37
38     @SerializedName("severity")
39     private String severity;
40
41     @SerializedName("violationType")
42     private String violationType;
43
44     @SerializedName("errorMessage")
45     private String errorMessage;
46
47     public String getViolationId() {
48         return violationId;
49     }
50
51     public void setViolationId(String violationId) {
52         this.violationId = violationId;
53     }
54
55     public String getModelName() {
56         return modelName;
57     }
58
59     public void setModelName(String modelName) {
60         this.modelName = modelName;
61     }
62
63     public String getCategory() {
64         return category;
65     }
66
67     public void setCategory(String category) {
68         this.category = category;
69     }
70
71     public String getSeverity() {
72         return severity;
73     }
74
75     public void setSeverity(String severity) {
76         this.severity = severity;
77     }
78
79     public String getViolationType() {
80         return violationType;
81     }
82
83     public void setViolationType(String violationType) {
84         this.violationType = violationType;
85     }
86
87     public String getErrorMessage() {
88         return errorMessage;
89     }
90
91     public void setErrorMessage(String errorMessage) {
92         this.errorMessage = errorMessage;
93     }
94
95     @Override
96     public String toString() {
97         return "Violation{" + "violationId='" + violationId + '\'' + ", modelName='" + modelName + '\'' + ", category='"
98                 + category + '\'' + ", severity='" + severity + '\'' + ", violationType='" + violationType + '\''
99                 + ", errorMessage='" + errorMessage + '\'' + '}';
100     }
101
102     @Override
103     public boolean equals(Object o) {
104         if (this == o) {
105             return true;
106         }
107         if (o == null || getClass() != o.getClass()) {
108             return false;
109         }
110         Violation violation = (Violation) o;
111         return Objects.equals(violationId, violation.violationId) && Objects.equals(modelName, violation.modelName)
112                 && Objects.equals(category, violation.category) && Objects.equals(severity, violation.severity)
113                 && Objects.equals(violationType, violation.violationType)
114                 && Objects.equals(errorMessage, violation.errorMessage);
115     }
116
117     @Override
118     public int hashCode() {
119         return Objects.hash(violationId, modelName, category, severity, violationType, errorMessage);
120     }
121 }