diff options
Diffstat (limited to 'catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java | 217 |
1 files changed, 11 insertions, 206 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java index 3d5741255a..a1a485d4ff 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/RequirementDefinition.java @@ -22,220 +22,25 @@ package org.openecomp.sdc.be.model; import java.io.Serializable; +import org.openecomp.sdc.be.datatypes.elements.RequirementDataDefinition; + /** * Specifies the requirements that the Node Type exposes. */ -public class RequirementDefinition implements Serializable { - - /** - * - */ - private static final long serialVersionUID = -8840549489409274532L; - - /** - * Unique id of the requirement - */ - private String uniqueId; - - private String name; - - /** - * specify the capability type - */ - private String capability; - - /** - * specify the node type(Optional by tosca) - */ - private String node; - - /** - * specify the relationship type(Optional by tosca) - */ - private String relationship; +public class RequirementDefinition extends RequirementDataDefinition implements Serializable { - // specifies the resource instance holding this requirement - private String ownerId; - private String ownerName; - - private String minOccurrences; - private String maxOccurrences; - - public RequirementDefinition() { + public RequirementDefinition(){ super(); } - + public RequirementDefinition(RequirementDefinition other) { - this.uniqueId = other.uniqueId; - this.name = other.name; - this.capability = other.capability; - this.node = other.node; - this.relationship = other.relationship; - this.ownerId = other.ownerId; - this.ownerName = other.ownerName; - this.minOccurrences = other.minOccurrences; - this.maxOccurrences = other.maxOccurrences; - - } - - public String getUniqueId() { - return uniqueId; - } - - public void setUniqueId(String uniqueId) { - this.uniqueId = uniqueId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getCapability() { - return capability; - } - - public void setCapability(String capability) { - this.capability = capability; - } - - public String getNode() { - return node; - } - - public void setNode(String node) { - this.node = node; + super(other); } - - public String getRelationship() { - return relationship; - } - - public void setRelationship(String relationship) { - this.relationship = relationship; - } - - // public RequirementImplDef getRequirementImpl() { - // return requirementImpl; - // } - // - // public void setRequirementImpl(RequirementImplDef requirementImpl) { - // this.requirementImpl = requirementImpl; - // } - - public String getOwnerId() { - return ownerId; - } - - public void setOwnerId(String ownerId) { - this.ownerId = ownerId; - } - - public String getOwnerName() { - return ownerName; - } - - public void setOwnerName(String ownerName) { - this.ownerName = ownerName; - } - - public String getMinOccurrences() { - return minOccurrences; - } - - public void setMinOccurrences(String minOccurrences) { - this.minOccurrences = minOccurrences; - } - - public String getMaxOccurrences() { - return maxOccurrences; - } - - public void setMaxOccurrences(String maxOccurrences) { - this.maxOccurrences = maxOccurrences; - } - - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((capability == null) ? 0 : capability.hashCode()); - result = prime * result + ((name == null) ? 0 : name.hashCode()); - result = prime * result + ((node == null) ? 0 : node.hashCode()); - result = prime * result + ((ownerId == null) ? 0 : ownerId.hashCode()); - result = prime * result + ((ownerName == null) ? 0 : ownerName.hashCode()); - result = prime * result + ((relationship == null) ? 0 : relationship.hashCode()); - result = prime * result + ((uniqueId == null) ? 0 : uniqueId.hashCode()); - result = prime * result + ((minOccurrences == null) ? 0 : minOccurrences.hashCode()); - result = prime * result + ((maxOccurrences == null) ? 0 : maxOccurrences.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; - RequirementDefinition other = (RequirementDefinition) obj; - if (capability == null) { - if (other.capability != null) - return false; - } else if (!capability.equals(other.capability)) - return false; - if (name == null) { - if (other.name != null) - return false; - } else if (!name.equals(other.name)) - return false; - if (node == null) { - if (other.node != null) - return false; - } else if (!node.equals(other.node)) - return false; - if (ownerId == null) { - if (other.ownerId != null) - return false; - } else if (!ownerId.equals(other.ownerId)) - return false; - if (ownerName == null) { - if (other.ownerName != null) - return false; - } else if (!ownerName.equals(other.ownerName)) - return false; - if (relationship == null) { - if (other.relationship != null) - return false; - } else if (!relationship.equals(other.relationship)) - return false; - if (uniqueId == null) { - if (other.uniqueId != null) - return false; - } else if (!uniqueId.equals(other.uniqueId)) - return false; - if (minOccurrences == null) { - if (other.minOccurrences != null) - return false; - } else if (!minOccurrences.equals(other.minOccurrences)) - return false; - if (maxOccurrences == null) { - if (other.maxOccurrences != null) - return false; - } else if (!maxOccurrences.equals(other.maxOccurrences)) - return false; - return true; - } - - @Override - public String toString() { - return "RequirementDefinition [uniqueId=" + uniqueId + ", name=" + name + ", capability=" + capability - + ", node=" + node + ", relationship=" + relationship + ", ownerId=" + ownerId + ", ownerName=" - + ownerName + ", minOccurrences=" + minOccurrences + ", maxOccurrences=" + maxOccurrences + "]"; + + public RequirementDefinition(RequirementDataDefinition requirementDataDefinition) { + super(requirementDataDefinition); } + + private static final long serialVersionUID = -1899506746481882719L; } |