/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
+ * Copyright (C) 2019, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
package org.onap.policy.models.base;
+import java.io.Serial;
import java.util.List;
import lombok.EqualsAndHashCode;
+import lombok.Getter;
import lombok.NonNull;
import lombok.ToString;
-import org.onap.policy.common.parameters.BeanValidationResult;
-import org.onap.policy.common.parameters.ValidationResult;
+import org.onap.policy.common.parameters.annotations.NotNull;
import org.onap.policy.common.utils.validation.Assertions;
+import org.onap.policy.models.base.validation.annotations.VerifyKey;
/**
* This class records a usage of a key in the system. When the list of keys being used by a concept
@EqualsAndHashCode(callSuper = false)
@ToString
public class PfKeyUse extends PfKey {
+ @Serial
private static final long serialVersionUID = 2007147220109881705L;
+ @VerifyKey
+ @NotNull
+ @Getter
private PfKey usedKey;
/**
}
@Override
- public ValidationResult validate(@NonNull String fieldName) {
- BeanValidationResult result = new BeanValidationResult(fieldName, this);
- result.addResult(validateKeyNotNull("usedKey", usedKey));
- return result;
- }
-
- @Override
- public int compareTo(final PfConcept otherObj) {
+ public int compareTo(@NonNull final PfConcept otherObj) {
Assertions.argumentNotNull(otherObj, "comparison object may not be null");
if (this == otherObj) {