From dc101c2ad5e27d5a0afd4e2feeb8885f24728806 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 24 Aug 2021 13:20:26 -0400 Subject: Use CompareToBuilder Also added lombok to test classes. Issue-ID: POLICY-3391 Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56 Signed-off-by: Jim Hahn --- .../apex/auth/clicodegen/DummyStErrorListener.java | 30 +++++++--------------- .../apex/auth/clicodegen/SupportKeyInfoGetter.java | 13 +++------- 2 files changed, 12 insertions(+), 31 deletions(-) (limited to 'auth/cli-codegen') diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java index 45d307b47..572b40e74 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/DummyStErrorListener.java @@ -1,25 +1,29 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 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. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * + * * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ package org.onap.policy.apex.auth.clicodegen; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.Setter; import org.stringtemplate.v4.STErrorListener; import org.stringtemplate.v4.misc.STMessage; @@ -31,6 +35,8 @@ import org.stringtemplate.v4.misc.STMessage; public class DummyStErrorListener implements STErrorListener { /** Counts errors of the listener. */ + @Getter(AccessLevel.PROTECTED) + @Setter(AccessLevel.PROTECTED) private int errorCount; /** @@ -90,22 +96,4 @@ public class DummyStErrorListener implements STErrorListener { setErrorCount(getErrorCount() + 1); System.err.println("STG/ST (" + msg.error + ") " + msg.arg + " -> " + msg.cause); } - - /** - * Gets the error count. - * - * @return the error count - */ - protected int getErrorCount() { - return errorCount; - } - - /** - * Sets the error count. - * - * @param errorCount the new error count - */ - protected void setErrorCount(final int errorCount) { - this.errorCount = errorCount; - } } diff --git a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java index 5547aa4f7..567991666 100644 --- a/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java +++ b/auth/cli-codegen/src/test/java/org/onap/policy/apex/auth/clicodegen/SupportKeyInfoGetter.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. + * Modifications Copyright (C) 2021 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. @@ -20,6 +21,7 @@ package org.onap.policy.apex.auth.clicodegen; +import lombok.AllArgsConstructor; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; import org.onap.policy.apex.model.basicmodel.concepts.AxKeyInfo; import org.onap.policy.apex.model.basicmodel.concepts.AxReferenceKey; @@ -30,21 +32,12 @@ import org.onap.policy.apex.model.policymodel.concepts.AxPolicyModel; * * @author John Keeney (john.keeney@ericsson.com) */ - +@AllArgsConstructor public class SupportKeyInfoGetter { /** The policy model for the getters. */ private final AxPolicyModel model; - /** - * Creates a new key getter. - * - * @param model the policy model to use - */ - public SupportKeyInfoGetter(final AxPolicyModel model) { - this.model = model; - } - /** * Returns the key name as string. * -- cgit 1.2.3-korg