/*-
* ============LICENSE_START=======================================================
* Copyright (C) 2019 Nordix Foundation.
+ * 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.
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
-
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
-
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
-
import org.onap.policy.common.utils.validation.Assertions;
import org.onap.policy.models.base.PfValidationResult.ValidationResult;
*/
public PfModel(@NonNull final PfModel copyConcept) {
super(copyConcept);
+ this.key = new PfConceptKey(copyConcept.key);
}
/**
result = validateArtifactKeyInModel((PfConceptKey) pfKey, artifactKeySet, result);
} else if (pfKey instanceof PfReferenceKey) {
result = validateReferenceKeyInModel((PfReferenceKey) pfKey, referenceKeySet, result);
- }
- // It must be a PfKeyUse, nothing else is legal
- else {
+ } else {
+ // It must be a PfKeyUse, nothing else is legal
usedKeySet.add((PfKeyUse) pfKey);
}
}
return key.compareTo(other.key);
}
-
- @Override
- public PfConcept copyTo(@NonNull final PfConcept target) {
- Assertions.instanceOf(target, PfModel.class);
-
- final PfModel copy = ((PfModel) target);
- copy.setKey(new PfConceptKey(key));
-
- return copy;
- }
}