Removing jackson to mitigate cve-2017-4995
[vfc/nfvo/driver/vnfm/svnfm.git] / nokiav2 / driver / src / main / java / org / onap / vfc / nfvo / driver / vnfm / svnfm / nokia / vnfm / notification / ProcessedNotification.java
1 /*
2  * Copyright 2016-2017, Nokia Corporation
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 package org.onap.vfc.nfvo.driver.vnfm.svnfm.nokia.vnfm.notification;
17
18 import com.nokia.cbam.lcm.v32.model.OperationStatus;
19 import java.util.Objects;
20
21 /**
22  * Represents a notification successfully processed by the {@link LifecycleChangeNotificationManager}
23  */
24 class ProcessedNotification {
25     private String operationExecutionId;
26     //do not remove field the {@link LifecycleChangeNotificationManager} uses the equals
27     // method to compare notifications
28     private OperationStatus status;
29
30     ProcessedNotification(String operationExecutionId, OperationStatus status) {
31         this.operationExecutionId = operationExecutionId;
32         this.status = status;
33     }
34
35     /**
36      * @return the identifier of the operation
37      */
38     public String getOperationExecutionId() {
39         return operationExecutionId;
40     }
41
42     /**
43      * @param operationExecutionId the identifier of the operation
44      */
45     public void setOperationExecutionId(String operationExecutionId) {
46         this.operationExecutionId = operationExecutionId;
47     }
48
49     /**
50      * @return the status of the operation
51      */
52     public OperationStatus getStatus() {
53         return status;
54     }
55
56     /**
57      * @param status the status of the operation
58      */
59     public void setStatus(OperationStatus status) {
60         this.status = status;
61     }
62
63     @Override
64     //generated code. This is the recommended way to formulate equals
65     @SuppressWarnings({"squid:S00122", "squid:S1067"})
66     public boolean equals(Object o) {
67         if (this == o) return true;
68         if (o == null || getClass() != o.getClass()) return false;
69         ProcessedNotification that = (ProcessedNotification) o;
70         return Objects.equals(operationExecutionId, that.operationExecutionId) &&
71                 status == that.status;
72     }
73
74     @Override
75     public int hashCode() {
76         return Objects.hash(operationExecutionId, status);
77     }
78
79     @Override
80     public String toString() {
81         return "ProcessedNotification{" +
82                 "operationExecutionId=" + operationExecutionId + '"' +
83                 ", status=" + status +
84                 '}';
85     }
86 }