2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.onap.aai.prevalidation;
23 import com.google.gson.annotations.SerializedName;
25 import java.util.Objects;
27 public class Violation {
29 @SerializedName("violationId")
30 private String violationId;
32 @SerializedName("modelName")
33 private String modelName;
35 @SerializedName("category")
36 private String category;
38 @SerializedName("severity")
39 private String severity;
41 @SerializedName("violationType")
42 private String violationType;
44 @SerializedName("errorMessage")
45 private String errorMessage;
47 public String getViolationId() {
51 public void setViolationId(String violationId) {
52 this.violationId = violationId;
55 public String getModelName() {
59 public void setModelName(String modelName) {
60 this.modelName = modelName;
63 public String getCategory() {
67 public void setCategory(String category) {
68 this.category = category;
71 public String getSeverity() {
75 public void setSeverity(String severity) {
76 this.severity = severity;
79 public String getViolationType() {
83 public void setViolationType(String violationType) {
84 this.violationType = violationType;
87 public String getErrorMessage() {
91 public void setErrorMessage(String errorMessage) {
92 this.errorMessage = errorMessage;
96 public String toString() {
98 "violationId='" + violationId + '\'' +
99 ", modelName='" + modelName + '\'' +
100 ", category='" + category + '\'' +
101 ", severity='" + severity + '\'' +
102 ", violationType='" + violationType + '\'' +
103 ", errorMessage='" + errorMessage + '\'' +
108 public boolean equals(Object o) {
112 if (o == null || getClass() != o.getClass()) {
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);
125 public int hashCode() {
126 return Objects.hash(violationId, modelName, category, severity, violationType, errorMessage);