summaryrefslogtreecommitdiffstats
path: root/models-tosca/src/main/java/org/onap
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2019-04-15 09:55:12 -0400
committerJim Hahn <jrh3@att.com>2019-04-15 09:55:12 -0400
commit98508d7f797c8a94b5b4f03941f39be96db03166 (patch)
tree580ab5b040fe0ca94efe2f49f42414b02e042cdd /models-tosca/src/main/java/org/onap
parentaca88111b78129371aebd6d2c9250a8abb9cc2ac (diff)
Add conversion from plain Ident to IdentOptVersion
Added a "copy constructor" that copies an Ident to an Ident with an optional version. The reverse does not make sense, so did not add that (e.g., version may be null or may just be a prefix, while the version in Ident is major.minor.patch). Change-Id: Ifd3935a998cd4c1cb5113a59c5f36a7d9baf79ff Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'models-tosca/src/main/java/org/onap')
-rw-r--r--models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
index d5ddb0522..adfd616c3 100644
--- a/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
+++ b/models-tosca/src/main/java/org/onap/policy/models/tosca/authorative/concepts/ToscaPolicyIdentifierOptVersion.java
@@ -51,6 +51,11 @@ public class ToscaPolicyIdentifierOptVersion implements Comparable<ToscaPolicyId
this.version = source.version;
}
+ public ToscaPolicyIdentifierOptVersion(ToscaPolicyIdentifier source) {
+ this.name = source.getName();
+ this.version = source.getVersion();
+ }
+
/**
* Determines if the version is null/missing.
*