Merge "Remove the apache commons-lang dependency in aai-common"
[aai/aai-common.git] / aai-core / src / main / java / org / onap / aai / util / delta / RelationshipDelta.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.aai
4  * ================================================================================
5  * Copyright © 2017-2018 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 java.util.HashMap;
24 import java.util.Map;
25
26 import org.apache.commons.lang3.builder.ToStringBuilder;
27
28 import com.google.gson.annotations.SerializedName;
29
30 public class RelationshipDelta {
31
32     @SerializedName("action")
33     private DeltaAction action;
34
35     @SerializedName("in-v-uuid")
36     private String inVUuid;
37
38     @SerializedName("out-v-uuid")
39     private String outVUuid;
40
41     @SerializedName("in-v-uri")
42     private String inVUri;
43
44     @SerializedName("out-v-uri")
45     private String outVUri;
46
47     @SerializedName("label")
48     private String label;
49
50     @SerializedName("props")
51     private Map<String, Object> props = new HashMap<>();
52
53     public RelationshipDelta(DeltaAction action, String inVUUID, String outVUUID, String inVUri, String outVUri, String label) {
54         this.action = action;
55         this.inVUuid = inVUUID;
56         this.outVUuid = outVUUID;
57         this.inVUri = inVUri;
58         this.outVUri = outVUri;
59         this.label = label;
60     }
61
62     public DeltaAction getAction() {
63         return action;
64     }
65
66     public void setAction(DeltaAction action) {
67         this.action = action;
68     }
69
70     public String getInVUuid() {
71         return inVUuid;
72     }
73
74     public void setInVUuid(String inVUuid) {
75         this.inVUuid = inVUuid;
76     }
77
78     public String getOutVUuid() {
79         return outVUuid;
80     }
81
82     public void setOutVUuid(String outVUuid) {
83         this.outVUuid = outVUuid;
84     }
85
86     public String getInVUri() {
87         return inVUri;
88     }
89
90     public void setInVUri(String inVUri) {
91         this.inVUri = inVUri;
92     }
93
94     public String getOutVUri() {
95         return outVUri;
96     }
97
98     public void setOutVUri(String outVUri) {
99         this.outVUri = outVUri;
100     }
101
102     public String getLabel() {
103         return label;
104     }
105
106     public void setLabel(String label) {
107         this.label = label;
108     }
109
110     public Map<String, Object> getProps() {
111         return props;
112     }
113
114     public void setProps(Map<String, Object> props) {
115         this.props = props;
116     }
117
118     public void addProp(String key, String value) {
119         this.props.put(key, value);
120     }
121
122     @Override
123     public String toString() {
124         return new ToStringBuilder(this)
125             .append("action", action)
126             .append("inVUuid", inVUuid)
127             .append("outVUuid", outVUuid)
128             .append("inVUri", inVUri)
129             .append("outVUri", outVUri)
130             .append("label", label)
131             .append("props", props)
132             .toString();
133     }
134 }