aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java35
1 files changed, 29 insertions, 6 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java
index e610d6c40..acbf778ea 100644
--- a/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java
@@ -20,15 +20,16 @@
package org.onap.vid.mso.model;
+import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
+import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
+
+import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.onap.vid.mso.rest.SubscriberInfo;
-
import java.util.List;
import java.util.Map;
-
-import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_EMPTY;
-import static com.fasterxml.jackson.annotation.JsonInclude.Include.NON_NULL;
+import java.util.Objects;
+import org.onap.vid.mso.rest.SubscriberInfo;
public class ServiceInstantiationRequestDetails {
@@ -122,7 +123,11 @@ public class ServiceInstantiationRequestDetails {
private final String name;
private final String value;
- public UserParamNameAndValue(String name, String value) {
+ @JsonCreator
+ public UserParamNameAndValue(
+ @JsonProperty("name") String name,
+ @JsonProperty("value") String value
+ ) {
this.name = name;
this.value = value;
}
@@ -134,6 +139,24 @@ public class ServiceInstantiationRequestDetails {
public String getValue() {
return value;
}
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof UserParamNameAndValue)) {
+ return false;
+ }
+ UserParamNameAndValue that = (UserParamNameAndValue) o;
+ return Objects.equals(getName(), that.getName()) &&
+ Objects.equals(getValue(), that.getValue());
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getName(), getValue());
+ }
}
public static class HomingSolution implements UserParamTypes {