diff options
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java index 259405c4e..01cc11d95 100644 --- a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java +++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java @@ -20,11 +20,17 @@ package org.onap.vid.model; -public class ServiceInstanceSearchResult { +import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.StringUtils; +import org.onap.vid.roles.WithPermissionProperties; + +public class ServiceInstanceSearchResult implements WithPermissionProperties { + + private final String SUBSCRIBER_ID_FRONTEND_ALIAS = "globalCustomerId"; private String serviceInstanceId; - private String globalCustomerId; + private String subscriberId; private String serviceType; @@ -39,13 +45,13 @@ public class ServiceInstanceSearchResult { private boolean isPermitted; public ServiceInstanceSearchResult(){ - } - public ServiceInstanceSearchResult(String serviceInstanceId, String globalCustomerId, String serviceType, + + public ServiceInstanceSearchResult(String serviceInstanceId, String subscriberId, String serviceType, String serviceInstanceName, String subscriberName, String aaiModelInvariantId, String aaiModelVersionId, boolean isPermitted) { this.serviceInstanceId = serviceInstanceId; - this.globalCustomerId = globalCustomerId; + this.subscriberId = subscriberId; this.serviceType = serviceType; this.serviceInstanceName = serviceInstanceName; this.subscriberName = subscriberName; @@ -62,14 +68,17 @@ public class ServiceInstanceSearchResult { this.serviceInstanceId = serviceInstanceId; } - public String getGlobalCustomerId() { - return globalCustomerId; + @Override + @JsonProperty(SUBSCRIBER_ID_FRONTEND_ALIAS) + public String getSubscriberId() { + return subscriberId; } - public void setGlobalCustomerId(String globalCustomerId) { - this.globalCustomerId = globalCustomerId; + public void setSubscriberId(String subscriberId) { + this.subscriberId = subscriberId; } + @Override public String getServiceType() { return serviceType; } @@ -119,21 +128,21 @@ public class ServiceInstanceSearchResult { } @Override - public boolean equals(Object other){ - if (other instanceof ServiceInstanceSearchResult) { - ServiceInstanceSearchResult serviceInstanceSearchResultOther = (ServiceInstanceSearchResult) other; - if (this.getServiceInstanceId().equals(serviceInstanceSearchResultOther.getServiceInstanceId())) { - return true; - } + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; } - return false; + ServiceInstanceSearchResult that = (ServiceInstanceSearchResult) o; + + return StringUtils.equals(serviceInstanceId, that.serviceInstanceId); } @Override public int hashCode() { - int result = 17; - result = 31 * result + serviceInstanceId.hashCode(); - return result; + return serviceInstanceId != null ? serviceInstanceId.hashCode() : 0; } } |