diff options
author | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-29 07:17:23 -0500 |
---|---|---|
committer | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-30 03:12:36 -0500 |
commit | f69660e15ab9a1545f70f1545c18da6768488c26 (patch) | |
tree | b84c18ab7f6ea69f02a9c636ccd655f7d0d32772 | |
parent | 0f7de86b1e0c2c5bcb9d720b505ccdffbdf4fc08 (diff) |
Changes in preparation for the m2 model (part 2)
This change was missed earlier: convert 'ResourceType' to a 'String',
so application-specific types can be added.
Issue-ID: POLICY-1948
Change-Id: Ie8a35e7fb0746d8c8e3a6db11c09ca31dc4763cc
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
3 files changed, 18 insertions, 100 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 8bdf9d3d4..61b6e3afd 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 @@ -23,7 +23,11 @@ package org.onap.policy.sdc; import java.io.Serializable; import java.util.UUID; +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter public class Resource implements Serializable { private static final long serialVersionUID = -913729158733348027L; @@ -32,7 +36,7 @@ public class Resource implements Serializable { private UUID resourceInvariantUuid; private String resourceName; private String resourceVersion; - private ResourceType resourceType; + private String resourceType; public Resource() { //Empty Constructor @@ -55,7 +59,7 @@ public class Resource implements Serializable { this.resourceUuid = uuid; } - public Resource(String name, ResourceType type) { + public Resource(String name, String type) { this.resourceName = name; this.resourceType = type; } @@ -69,7 +73,7 @@ public class Resource implements Serializable { * @param version version * @param type type */ - public Resource(UUID uuid, UUID invariantUuid, String name, String version, ResourceType type) { + public Resource(UUID uuid, UUID invariantUuid, String name, String version, String type) { this.resourceUuid = uuid; this.resourceInvariantUuid = invariantUuid; this.resourceName = name; @@ -77,46 +81,6 @@ public class Resource implements Serializable { this.resourceType = type; } - public UUID getResourceUuid() { - return resourceUuid; - } - - public void setResourceUuid(UUID resourceUuid) { - this.resourceUuid = resourceUuid; - } - - public UUID getResourceInvariantUuid() { - return resourceInvariantUuid; - } - - public void setResourceInvariantUuid(UUID resourceInvariantUuid) { - this.resourceInvariantUuid = resourceInvariantUuid; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - - public String getResourceVersion() { - return resourceVersion; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - @Override public String toString() { return "Resource [resourceUuid=" + resourceUuid + ", resourceInvariantUuid=" + resourceInvariantUuid 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 9c1db8a55..05842e24c 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 @@ -23,7 +23,11 @@ package org.onap.policy.sdc; import java.io.Serializable; import java.util.UUID; +import lombok.Getter; +import lombok.Setter; +@Getter +@Setter public class ResourceInstance implements Serializable { private static final long serialVersionUID = -5506162340393802424L; @@ -32,7 +36,7 @@ public class ResourceInstance implements Serializable { private String resourceName; private UUID resourceInvariantUuid; private String resourceVersion; - private ResourceType resourceType; + private String resourceType; private UUID resourceUuid; public ResourceInstance() { @@ -56,22 +60,6 @@ public class ResourceInstance implements Serializable { this.resourceUuid = instance.resourceUuid; } - public String getResourceInstanceName() { - return resourceInstanceName; - } - - public void setResourceInstanceName(String resourceInstanceName) { - this.resourceInstanceName = resourceInstanceName; - } - - public String getResourceName() { - return resourceName; - } - - public void setResourceName(String resourceName) { - this.resourceName = resourceName; - } - public UUID getResourceInvariantUUID() { return resourceInvariantUuid; } @@ -80,30 +68,6 @@ public class ResourceInstance implements Serializable { this.resourceInvariantUuid = resourceInvariantUuid; } - public String getResourceVersion() { - return resourceVersion; - } - - public void setResourceVersion(String resourceVersion) { - this.resourceVersion = resourceVersion; - } - - public ResourceType getResourceType() { - return resourceType; - } - - public void setResourceType(ResourceType resourceType) { - this.resourceType = resourceType; - } - - public UUID getResourceUuid() { - return resourceUuid; - } - - public void setResourceUuid(UUID resourceUuid) { - this.resourceUuid = resourceUuid; - } - @Override public String toString() { return "ResourceInstance [resourceInstanceName=" + resourceInstanceName + ", resourceName=" + resourceName diff --git a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceType.java b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceType.java index c055cbb50..34cefa1ab 100644 --- a/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceType.java +++ b/models-interactions/model-impl/sdc/src/main/java/org/onap/policy/sdc/ResourceType.java @@ -21,22 +21,12 @@ package org.onap.policy.sdc; -public enum ResourceType { - VF("VF"), - VFC("VFC"), - VL("VL"), - CP("CP") - ; +public class ResourceType { + public static final String VF = "VF"; + public static final String VFC = "VFC"; + public static final String VL = "VL"; + public static final String CP = "CP"; - private String type; - - private ResourceType(String type) { - this.type = type; - } - - @Override - public String toString() { - return this.type; + private ResourceType() { } - } |