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