Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / model / RequestReferences.java
1
2 package org.onap.vid.mso.model;
3
4 import com.fasterxml.jackson.annotation.*;
5 import org.apache.commons.lang.builder.EqualsBuilder;
6 import org.apache.commons.lang.builder.HashCodeBuilder;
7 import org.apache.commons.lang.builder.ToStringBuilder;
8
9 import java.util.HashMap;
10 import java.util.Map;
11
12
13 /**
14  * provides the instanceId and requestId associated with the request
15  * 
16  */
17 @JsonInclude(JsonInclude.Include.NON_NULL)
18 @JsonPropertyOrder({
19     "instanceId",
20     "requestId"
21 })
22 public class RequestReferences {
23
24     /**
25      * UUID for the service instance
26      * (Required)
27      * 
28      */
29     @JsonProperty("instanceId")
30     private String instanceId;
31     /**
32      * UUID for the request
33      * (Required)
34      * 
35      */
36     @JsonProperty("requestId")
37     private String requestId;
38     @JsonIgnore
39     private Map<String, Object> additionalProperties = new HashMap<>();
40
41     /**
42      * UUID for the service instance
43      * (Required)
44      * 
45      * @return
46      *     The instanceId
47      */
48     @JsonProperty("instanceId")
49     public String getInstanceId() {
50         return instanceId;
51     }
52
53     /**
54      * UUID for the service instance
55      * (Required)
56      * 
57      * @param instanceId
58      *     The instanceId
59      */
60     @JsonProperty("instanceId")
61     public void setInstanceId(String instanceId) {
62         this.instanceId = instanceId;
63     }
64
65     /**
66      * UUID for the request
67      * (Required)
68      * 
69      * @return
70      *     The requestId
71      */
72     @JsonProperty("requestId")
73     public String getRequestId() {
74         return requestId;
75     }
76
77     /**
78      * UUID for the request
79      * (Required)
80      * 
81      * @param requestId
82      *     The requestId
83      */
84     @JsonProperty("requestId")
85     public void setRequestId(String requestId) {
86         this.requestId = requestId;
87     }
88
89     @Override
90     public String toString() {
91         return ToStringBuilder.reflectionToString(this);
92     }
93
94     @JsonAnyGetter
95     public Map<String, Object> getAdditionalProperties() {
96         return this.additionalProperties;
97     }
98
99     @JsonAnySetter
100     public void setAdditionalProperty(String name, Object value) {
101         this.additionalProperties.put(name, value);
102     }
103
104     @Override
105     public int hashCode() {
106         return new HashCodeBuilder().append(instanceId).append(requestId).append(additionalProperties).toHashCode();
107     }
108
109     @Override
110     public boolean equals(Object other) {
111         if (other == this) {
112             return true;
113         }
114         if (!(other instanceof RequestReferences)) {
115             return false;
116         }
117         RequestReferences rhs = ((RequestReferences) other);
118         return new EqualsBuilder().append(instanceId, rhs.instanceId).append(requestId, rhs.requestId).append(additionalProperties, rhs.additionalProperties).isEquals();
119     }
120
121 }