diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2020-01-08 16:03:08 +0200 |
---|---|---|
committer | Ittay Stern <ittay.stern@att.com> | 2020-01-09 17:17:46 +0200 |
commit | 6b5dd86a3557e8eed2c4584f5d16df5654cbc57b (patch) | |
tree | f3978f5e3e92a5728f8bdb89146de38305b16fb7 /vid-app-common/src/main/java/org/onap/vid/mso/model/ServiceInstantiationRequestDetails.java | |
parent | e8414b1fe839291418ead3a7e5a64bf382dc1121 (diff) |
Fix the format of supplementary file and user params for aLaCarte requests
supplementary file shall be in format [{"name": "fieldName", "value" : "xyz"}]
Also this is the format of each param in user params for aLaCarte requests and old macros
Issue-ID: VID-743
Change-Id: I579298ce3f0b789a7a69e6af5a85bfbd50ae9fc0
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
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.java | 35 |
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 { |