Replace copyTo methods with copy constructors
[policy/models.git] / models-base / src / main / java / org / onap / policy / models / base / PfConceptKey.java
index 17fda7c..f5baae7 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019 Nordix Foundation.
- *  ModificationsCopyright (C) 2019 AT&T Intellectual Property. All rights reserved.
+ *  Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -73,6 +73,8 @@ public class PfConceptKey extends PfKey {
      */
     public PfConceptKey(@NonNull final PfConceptKey copyConcept) {
         super(copyConcept);
+        this.name = copyConcept.name;
+        this.version = copyConcept.version;
     }
 
     /**
@@ -288,20 +290,6 @@ public class PfConceptKey extends PfKey {
         version = Assertions.validateStringParameter(VERSION_TOKEN, version, VERSION_REGEXP);
     }
 
-    @Override
-    public PfConcept copyTo(final PfConcept target) {
-        Assertions.argumentNotNull(target, "target may not be null");
-
-        final PfConcept copyObject = target;
-        Assertions.instanceOf(copyObject, PfConceptKey.class);
-
-        final PfConceptKey copy = ((PfConceptKey) copyObject);
-        copy.setName(name);
-        copy.setVersion(version);
-
-        return copyObject;
-    }
-
     @Override
     public int compareTo(@NonNull final PfConcept otherObj) {
         Assertions.argumentNotNull(otherObj, "comparison object may not be null");