Changes for Checkstyle 8.32
[policy/models.git] / models-base / src / main / java / org / onap / policy / models / base / PfReferenceKey.java
index 185ccfa..7984e42 100644 (file)
@@ -1,6 +1,7 @@
 /*-
  * ============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.
@@ -22,14 +23,11 @@ package org.onap.policy.models.base;
 
 import java.util.ArrayList;
 import java.util.List;
-
 import javax.persistence.Column;
 import javax.persistence.Embeddable;
-
 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;
 
@@ -73,16 +71,16 @@ public class PfReferenceKey extends PfKey {
     private static final int PARENT_LOCAL_NAME_FIELD = 2;
     private static final int LOCAL_NAME_FIELD = 3;
 
-    @Column(name = PARENT_KEY_NAME, length = 128)
+    @Column(name = PARENT_KEY_NAME, length = 120)
     private String parentKeyName;
 
-    @Column(name = PARENT_KEY_VERSION, length = 128)
+    @Column(name = PARENT_KEY_VERSION, length = 15)
     private String parentKeyVersion;
 
-    @Column(name = PARENT_LOCAL_NAME, length = 128)
+    @Column(name = PARENT_LOCAL_NAME, length = 120)
     private String parentLocalName;
 
-    @Column(name = LOCAL_NAME, length = 128)
+    @Column(name = LOCAL_NAME, length = 120)
     private String localName;
 
     /**
@@ -381,22 +379,6 @@ public class PfReferenceKey extends PfKey {
         localName = Assertions.validateStringParameter(LOCAL_NAME, localName, LOCAL_NAME_REGEXP);
     }
 
-    @Override
-    public PfConcept copyTo(final PfConcept target) {
-        Assertions.argumentNotNull(target, "target may not be null");
-
-        final Object copyObject = target;
-        Assertions.instanceOf(copyObject, PfReferenceKey.class);
-
-        final PfReferenceKey copy = ((PfReferenceKey) copyObject);
-        copy.setParentKeyName(parentKeyName);
-        copy.setParentKeyVersion(parentKeyVersion);
-        copy.setLocalName(localName);
-        copy.setParentLocalName(parentLocalName);
-
-        return copy;
-    }
-
     @Override
     public int compareTo(final PfConcept otherObj) {
         Assertions.argumentNotNull(otherObj, "comparison object may not be null");
@@ -405,7 +387,7 @@ public class PfReferenceKey extends PfKey {
             return 0;
         }
         if (getClass() != otherObj.getClass()) {
-            return this.hashCode() - otherObj.hashCode();
+            return getClass().getName().compareTo(otherObj.getClass().getName());
         }
 
         final PfReferenceKey other = (PfReferenceKey) otherObj;