Remove the apache commons-lang dependency in 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 package org.onap.aai.util.delta;
21
22 import org.apache.commons.lang3.builder.ToStringBuilder;
23
24 import com.google.gson.annotations.SerializedName;
25
26 public class PropertyDelta {
27
28     @SerializedName("action")
29     protected DeltaAction action;
30
31     @SerializedName("value")
32     protected Object value;
33
34     @SerializedName("old-value")
35     private Object oldValue;
36
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)
75             .append("action", action)
76             .append("value", value)
77             .append("oldValue", oldValue)
78             .toString();
79     }
80 }