Remove DMaaP dependency from AAI-Common
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / util / delta / PropertyDelta.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2019 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.util.delta;
22
23 import com.google.gson.annotations.SerializedName;
24
25 import org.apache.commons.lang3.builder.ToStringBuilder;
26
27 public class PropertyDelta {
28
29     @SerializedName("action")
30     protected DeltaAction action;
31
32     @SerializedName("value")
33     protected Object value;
34
35     @SerializedName("old-value")
36     private Object oldValue;
37
38     public PropertyDelta(DeltaAction action, Object value) {
39         this.action = action;
40         this.value = value;
41     }
42
43     public PropertyDelta(DeltaAction action, Object value, Object oldValue) {
44         this(action, value);
45         this.oldValue = oldValue;
46     }
47
48     public DeltaAction getAction() {
49         return action;
50     }
51
52     public void setAction(DeltaAction action) {
53         this.action = action;
54     }
55
56     public Object getValue() {
57         return value;
58     }
59
60     public void setValue(Object value) {
61         this.value = value;
62     }
63
64     public Object getOldValue() {
65         return oldValue;
66     }
67
68     public void setOldValue(Object oldValue) {
69         this.oldValue = oldValue;
70     }
71
72     @Override
73     public String toString() {
74         return new ToStringBuilder(this).append("action", action).append("value", value).append("oldValue", oldValue)
75                 .toString();
76     }
77 }