diff options
Diffstat (limited to 'models-interactions/model-impl/sdc/src/main')
4 files changed, 65 insertions, 339 deletions
diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java index 61b6e3afd..d5e8b6c2a 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Resource.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. @@ -23,23 +23,22 @@ package org.onap.policy.sdc; import java.io.Serializable; import java.util.UUID; -import lombok.Getter; -import lombok.Setter; -@Getter -@Setter +import lombok.Data; + +@Data public class Resource implements Serializable { private static final long serialVersionUID = -913729158733348027L; - private UUID resourceUuid; - private UUID resourceInvariantUuid; - private String resourceName; - private String resourceVersion; - private String resourceType; + private UUID resourceUuid; + private UUID resourceInvariantUuid; + private String resourceName; + private String resourceVersion; + private String resourceType; public Resource() { - //Empty Constructor + // Empty Constructor } /** @@ -80,74 +79,4 @@ public class Resource implements Serializable { this.resourceVersion = version; this.resourceType = type; } - - @Override - public String toString() { - return "Resource [resourceUuid=" + resourceUuid + ", resourceInvariantUuid=" + resourceInvariantUuid - + ", resourceName=" + resourceName + ", resourceVersion=" + resourceVersion + ", resourceType=" - + resourceType + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((resourceInvariantUuid == null) ? 0 : resourceInvariantUuid.hashCode()); - result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode()); - result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); - result = prime * result + ((resourceUuid == null) ? 0 : resourceUuid.hashCode()); - result = prime * result + ((resourceVersion == null) ? 0 : resourceVersion.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; - } - Resource other = (Resource) obj; - if (resourceInvariantUuid == null) { - if (other.resourceInvariantUuid != null) { - return false; - } - } else if (!resourceInvariantUuid.equals(other.resourceInvariantUuid)) { - return false; - } - if (resourceName == null) { - if (other.resourceName != null) { - return false; - } - } else if (!resourceName.equals(other.resourceName)) { - return false; - } - if (resourceType == null) { - if (other.resourceType != null) { - return false; - } - } else if (!resourceType.equals(other.resourceType)) { - return false; - } - if (resourceUuid == null) { - if (other.resourceUuid != null) { - return false; - } - } else if (!resourceUuid.equals(other.resourceUuid)) { - return false; - } - if (resourceVersion == null) { - if (other.resourceVersion != null) { - return false; - } - } else if (!resourceVersion.equals(other.resourceVersion)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java index 05842e24c..0b6068dce 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceInstance.java @@ -21,26 +21,31 @@ 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 ResourceInstance implements Serializable { private static final long serialVersionUID = -5506162340393802424L; + @SerializedName("ResourceUUID") + private UUID resourceUuid; + private String resourceInstanceName; private String resourceName; - private UUID resourceInvariantUuid; private String resourceVersion; private String resourceType; - private UUID resourceUuid; + + @SerializedName("ResourceInvariantUUID") + private UUID resourceInvariantUuid; public ResourceInstance() { - //Empty Constructor + // Empty Constructor } /** @@ -59,86 +64,4 @@ public class ResourceInstance implements Serializable { this.resourceType = instance.resourceType; this.resourceUuid = instance.resourceUuid; } - - public UUID getResourceInvariantUUID() { - return resourceInvariantUuid; - } - - public void setResourceInvariantUUID(UUID resourceInvariantUuid) { - this.resourceInvariantUuid = resourceInvariantUuid; - } - - @Override - public String toString() { - return "ResourceInstance [resourceInstanceName=" + resourceInstanceName + ", resourceName=" + resourceName - + ", resourceInvariantUuid=" + resourceInvariantUuid + ", resourceVersion=" + resourceVersion - + ", resourceType=" + resourceType + ", resourceUuid=" + resourceUuid + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((resourceInstanceName == null) ? 0 : resourceInstanceName.hashCode()); - result = prime * result + ((resourceInvariantUuid == null) ? 0 : resourceInvariantUuid.hashCode()); - result = prime * result + ((resourceName == null) ? 0 : resourceName.hashCode()); - result = prime * result + ((resourceType == null) ? 0 : resourceType.hashCode()); - result = prime * result + ((resourceUuid == null) ? 0 : resourceUuid.hashCode()); - result = prime * result + ((resourceVersion == null) ? 0 : resourceVersion.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; - } - ResourceInstance other = (ResourceInstance) obj; - if (resourceInstanceName == null) { - if (other.resourceInstanceName != null) { - return false; - } - } else if (!resourceInstanceName.equals(other.resourceInstanceName)) { - return false; - } - if (resourceInvariantUuid == null) { - if (other.resourceInvariantUuid != null) { - return false; - } - } else if (!resourceInvariantUuid.equals(other.resourceInvariantUuid)) { - return false; - } - if (resourceName == null) { - if (other.resourceName != null) { - return false; - } - } else if (!resourceName.equals(other.resourceName)) { - return false; - } - if (resourceType != other.resourceType) { - return false; - } - if (resourceUuid == null) { - if (other.resourceUuid != null) { - return false; - } - } else if (!resourceUuid.equals(other.resourceUuid)) { - return false; - } - if (resourceVersion == null) { - if (other.resourceVersion != null) { - return false; - } - } else if (!resourceVersion.equals(other.resourceVersion)) { - return false; - } - return true; - } - } diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java index 7ab2f9322..765eeec54 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/Service.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,28 +21,33 @@ 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 Service implements Serializable { private static final long serialVersionUID = -1249276698549996806L; - private UUID serviceUUID; - private UUID serviceInvariantUUID; + @SerializedName("serviceUuid") + private UUID serviceUuid; + + @SerializedName("serviceInvariantUuid") + private UUID serviceInvariantUuid; + private String serviceName; private String serviceVersion; public Service() { - //Empty Constructor + // Empty Constructor } public Service(UUID uuid) { - this.serviceUUID = uuid; + this.serviceUuid = uuid; } public Service(String name) { @@ -53,13 +58,13 @@ public class Service implements Serializable { * Constructor. * * @param uuid service id - * @param invariantUUID service invariant id + * @param invariantUuid service invariant id * @param name name * @param version version */ - public Service(UUID uuid, UUID invariantUUID, String name, String version) { - this.serviceUUID = uuid; - this.serviceInvariantUUID = invariantUUID; + public Service(UUID uuid, UUID invariantUuid, String name, String version) { + this.serviceUuid = uuid; + this.serviceInvariantUuid = invariantUuid; this.serviceName = name; this.serviceVersion = version; } @@ -70,66 +75,9 @@ public class Service implements Serializable { * @param service copy object */ public Service(Service service) { - this.serviceUUID = service.serviceUUID; - this.serviceInvariantUUID = service.serviceInvariantUUID; + this.serviceUuid = service.serviceUuid; + this.serviceInvariantUuid = service.serviceInvariantUuid; this.serviceName = service.serviceName; this.serviceVersion = service.serviceVersion; } - - @Override - public String toString() { - return "Service [serviceUUID=" + serviceUUID + ", serviceInvariantUUID=" + serviceInvariantUUID - + ", serviceName=" + serviceName + ", serviceVersion=" + serviceVersion + "]"; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((serviceInvariantUUID == null) ? 0 : serviceInvariantUUID.hashCode()); - result = prime * result + ((serviceName == null) ? 0 : serviceName.hashCode()); - result = prime * result + ((serviceUUID == null) ? 0 : serviceUUID.hashCode()); - result = prime * result + ((serviceVersion == null) ? 0 : serviceVersion.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; - } - Service other = (Service) obj; - if (serviceInvariantUUID == null) { - if (other.serviceInvariantUUID != null) { - return false; - } - } else if (!serviceInvariantUUID.equals(other.serviceInvariantUUID)) { - 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 (serviceVersion == null) { - return other.serviceVersion == null; - } else { - return serviceVersion.equals(other.serviceVersion); - } - } } 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); - } - } } |