d420c5583dd9689cc072dd161a0f6a75a60e4f00
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / prevalidation / Validation.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  *  Modifications Copyright © 2018 IBM.
8  * ================================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  *    http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * ============LICENSE_END=========================================================
21  */
22 package org.onap.aai.prevalidation;
23
24 import com.google.gson.annotations.SerializedName;
25
26 import java.util.List;
27 import java.util.Objects;
28
29 public class Validation {
30
31     @SerializedName("validationId")
32     private String validationId;
33
34     @SerializedName("action")
35     private String action;
36
37     @SerializedName("violations")
38     private List<Violation> violations;
39
40     public String getValidationId() {
41         return validationId;
42     }
43
44     public void setValidationId(String validationId) {
45         this.validationId = validationId;
46     }
47
48     public List<Violation> getViolations() {
49         return violations;
50     }
51
52     public void setViolations(List<Violation> violations) {
53         this.violations = violations;
54     }
55
56     public String getAction() {
57         return action;
58     }
59
60     public void setAction(String action) {
61         this.action = action;
62     }
63
64     @Override
65     public boolean equals(Object o) {
66         if (this == o) {
67             return true;
68         }
69         if (o == null || getClass() != o.getClass()) {
70             return false;
71         }
72         Validation that = (Validation) o;
73         return Objects.equals(validationId, that.validationId) &&
74             Objects.equals(action, that.action) &&
75             Objects.equals(violations, that.violations);
76     }
77
78     @Override
79     public int hashCode() {
80         return Objects.hash(validationId, action, violations);
81     }
82
83     @Override
84     public String toString() {
85         return "Validation{" +
86             "validationId='" + validationId + '\'' +
87             ", action='" + action + '\'' +
88             ", violations=" + violations +
89             '}';
90     }
91
92 }