diff options
Diffstat (limited to 'model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java')
-rw-r--r-- | model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java index 7cb4dd832..55ea95c3a 100644 --- a/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java +++ b/model/basic-model/src/main/java/org/onap/policy/apex/model/basicmodel/concepts/AxReferenceKey.java @@ -38,16 +38,16 @@ import org.onap.policy.apex.model.utilities.Assertions; * A reference key identifies entities in the system that are contained in other entities. Every contained concept in * the system must have an {@link AxReferenceKey} to identify it. Non-contained first order concepts are identified * using an {@link AxArtifactKey} key. - * <p> - * An {@link AxReferenceKey} contains an {@link AxArtifactKey} key reference to the first order entity that contains it. - * The local name of the reference key must uniquely identify the referenced concept among those concepts contained in - * the reference key's parent. In other words, if a parent concept has more than one child, the local name in the key of - * all its children must be unique. - * <p> - * If a reference key's parent is itself a reference key, then the parent's local name must be set in the reference key. - * If the parent is a first order concept, then the parent's local name in the key will be set to NULL. - * <p> - * Key validation checks that the parent name and parent version fields match the {@link NAME_REGEXP} and + * + * <p>An {@link AxReferenceKey} contains an {@link AxArtifactKey} key reference to the first order entity that contains + * it. The local name of the reference key must uniquely identify the referenced concept among those concepts contained + * in the reference key's parent. In other words, if a parent concept has more than one child, the local name in the key + * of all its children must be unique. + * + * <p>If a reference key's parent is itself a reference key, then the parent's local name must be set in the reference + * key. If the parent is a first order concept, then the parent's local name in the key will be set to NULL. + * + * <p>Key validation checks that the parent name and parent version fields match the {@link NAME_REGEXP} and * {@link VERSION_REGEXP} regular expressions respectively and that the local name fields match the * {@link LOCAL_NAME_REGEXP} regular expression. */ @@ -69,7 +69,8 @@ public class AxReferenceKey extends AxKey { public static final String LOCAL_NAME_REGEXP = "[A-Za-z0-9\\-_\\.]+|^$"; /** Regular expression to specify the structure of IDs in reference keys. */ - public static final String REFERENCE_KEY_ID_REGEXP = "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+"; + public static final String REFERENCE_KEY_ID_REGEXP = + "[A-Za-z0-9\\-_]+:[0-9].[0-9].[0-9]:[A-Za-z0-9\\-_]+:[A-Za-z0-9\\-_]+"; private static final int PARENT_NAME_FIELD = 0; private static final int PARENT_VERSION_FIELD = 1; @@ -262,7 +263,7 @@ public class AxReferenceKey extends AxKey { * @see org.onap.policy.apex.model.basicmodel.concepts.AxKey#getID() */ @Override - public String getID() { + public String getId() { return parentKeyName + ':' + parentKeyVersion + ':' + parentLocalName + ':' + localName; } |