diff options
Diffstat (limited to 'models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java')
-rw-r--r-- | models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java | 120 |
1 files changed, 23 insertions, 97 deletions
diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java index e02952219..45e1dc56a 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ServiceInstance.java @@ -3,7 +3,7 @@ * sdc * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. - * Modifications Copyright (C) 2019 Nordix Foundation. + * Modifications Copyright (C) 2019-2020 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,27 +21,36 @@ package org.onap.policy.sdc; +import com.google.gson.annotations.SerializedName; + import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class ServiceInstance implements Serializable { private static final long serialVersionUID = 6285260780966679625L; - private UUID personaModelUUID; - private UUID serviceUUID; - private UUID serviceInstanceUUID; - private UUID widgetModelUUID; + @SerializedName("personaModelUUID") + private UUID personaModelUuid; + + @SerializedName("serviceUUID") + private UUID serviceUuid; + + @SerializedName("serviceInstanceUUID") + private UUID serviceInstanceUuid; + + @SerializedName("widgetModelUUID") + private UUID widgetModelUuid; + private String widgetModelVersion; private String serviceName; private String serviceInstanceName; public ServiceInstance() { - //Empty Constructor + // Empty Constructor } /** @@ -53,95 +62,12 @@ public class ServiceInstance implements Serializable { if (instance == null) { return; } - this.personaModelUUID = instance.personaModelUUID; - this.serviceUUID = instance.serviceUUID; - this.serviceInstanceUUID = instance.serviceInstanceUUID; - this.widgetModelUUID = instance.widgetModelUUID; + this.personaModelUuid = instance.personaModelUuid; + this.serviceUuid = instance.serviceUuid; + this.serviceInstanceUuid = instance.serviceInstanceUuid; + this.widgetModelUuid = instance.widgetModelUuid; this.widgetModelVersion = instance.widgetModelVersion; this.serviceName = instance.serviceName; this.serviceInstanceName = instance.serviceInstanceName; } - - @Override - public String toString() { - return "ServiceInstance [personaModelUUID=" + personaModelUUID + ", serviceUUID=" + serviceUUID - + ", serviceInstanceUUID=" + serviceInstanceUUID + ", widgetModelUUID=" + widgetModelUUID - + ", widgetModelVersion=" + widgetModelVersion + ", serviceName=" + serviceName - + ", serviceInstanceName=" + serviceInstanceName + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((personaModelUUID == null) ? 0 : personaModelUUID.hashCode()); - result = prime * result + ((serviceInstanceName == null) ? 0 : serviceInstanceName.hashCode()); - result = prime * result + ((serviceInstanceUUID == null) ? 0 : serviceInstanceUUID.hashCode()); - result = prime * result + ((serviceName == null) ? 0 : serviceName.hashCode()); - result = prime * result + ((serviceUUID == null) ? 0 : serviceUUID.hashCode()); - result = prime * result + ((widgetModelUUID == null) ? 0 : widgetModelUUID.hashCode()); - result = prime * result + ((widgetModelVersion == null) ? 0 : widgetModelVersion.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - ServiceInstance other = (ServiceInstance) obj; - if (personaModelUUID == null) { - if (other.personaModelUUID != null) { - return false; - } - } else if (!personaModelUUID.equals(other.personaModelUUID)) { - return false; - } - if (serviceInstanceName == null) { - if (other.serviceInstanceName != null) { - return false; - } - } else if (!serviceInstanceName.equals(other.serviceInstanceName)) { - return false; - } - if (serviceInstanceUUID == null) { - if (other.serviceInstanceUUID != null) { - return false; - } - } else if (!serviceInstanceUUID.equals(other.serviceInstanceUUID)) { - return false; - } - if (serviceName == null) { - if (other.serviceName != null) { - return false; - } - } else if (!serviceName.equals(other.serviceName)) { - return false; - } - if (serviceUUID == null) { - if (other.serviceUUID != null) { - return false; - } - } else if (!serviceUUID.equals(other.serviceUUID)) { - return false; - } - if (widgetModelUUID == null) { - if (other.widgetModelUUID != null) { - return false; - } - } else if (!widgetModelUUID.equals(other.widgetModelUUID)) { - return false; - } - if (widgetModelVersion == null) { - return other.widgetModelVersion == null; - } else { - return widgetModelVersion.equals(other.widgetModelVersion); - } - } } |