e5472a7c8ca466ec19c22f77334e101ca561822f
[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{" +
98             "violationId='" + violationId + '\'' +
99             ", modelName='" + modelName + '\'' +
100             ", category='" + category + '\'' +
101             ", severity='" + severity + '\'' +
102             ", violationType='" + violationType + '\'' +
103             ", errorMessage='" + errorMessage + '\'' +
104             '}';
105     }
106
107     @Override
108     public boolean equals(Object o) {
109         if (this == o) {
110             return true;
111         }
112         if (o == null || getClass() != o.getClass()) {
113             return false;
114         }
115         Violation violation = (Violation) o;
116         return Objects.equals(violationId, violation.violationId) &&
117             Objects.equals(modelName, violation.modelName) &&
118             Objects.equals(category, violation.category) &&
119             Objects.equals(severity, violation.severity) &&
120             Objects.equals(violationType, violation.violationType) &&
121             Objects.equals(errorMessage, violation.errorMessage);
122     }
123
124     @Override
125     public int hashCode() {
126         return Objects.hash(violationId, modelName, category, severity, violationType, errorMessage);
127     }
128 }