From 417e292dbaff7c30f86780e20da5fc95b108032a Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Thu, 17 Jun 2021 16:54:20 -0400 Subject: Use lombok for events, base, dao Issue-ID: POLICY-3396 Change-Id: I7b37efc13a25e0e27d63a85a3ee291e91a4e1682 Signed-off-by: Jim Hahn --- .../org/onap/policy/models/dao/DaoParameters.java | 77 ++-------------------- .../org/onap/policy/models/dao/DaoMiscTest.java | 6 +- 2 files changed, 10 insertions(+), 73 deletions(-) (limited to 'models-dao/src') diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/DaoParameters.java b/models-dao/src/main/java/org/onap/policy/models/dao/DaoParameters.java index a6b6f2f2e..98e31c423 100644 --- a/models-dao/src/main/java/org/onap/policy/models/dao/DaoParameters.java +++ b/models-dao/src/main/java/org/onap/policy/models/dao/DaoParameters.java @@ -1,6 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. + * 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. @@ -21,12 +22,18 @@ package org.onap.policy.models.dao; import java.util.Properties; +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; /** * This class is a POJO that holds properties for PF DAOs. * * @author Liam Fallon (liam.fallon@est.tech) */ +@Getter +@Setter +@ToString public class DaoParameters { /** The default PF DAO plugin class. */ public static final String DEFAULT_PLUGIN_CLASS = "org.onap.policy.models.dao.impl.DefaultPfDao"; @@ -36,65 +43,6 @@ public class DaoParameters { private Properties jdbcProperties = new Properties(); - /** - * Gets the DAO plugin class, this is the DAO class to use and it must implement the - * {@link PfDao} interface. - * - * @return the DAO plugin class - */ - public String getPluginClass() { - return pluginClass; - } - - /** - * Sets the DAO plugin class, a class that implements the {@link PfDao} interface. - * - * @param daoPluginClass the DAO plugin class - */ - public void setPluginClass(final String daoPluginClass) { - pluginClass = daoPluginClass; - } - - /** - * Gets the persistence unit for the DAO. The persistence unit defines the JDBC properties the - * DAO will use. The persistence unit must defined in the {@code META-INF/persistence.xml} - * resource file - * - * @return the persistence unit to use for JDBC access - */ - public String getPersistenceUnit() { - return persistenceUnit; - } - - /** - * Sets the persistence unit for the DAO. The persistence unit defines the JDBC properties the - * DAO will use. The persistence unit must defined in the {@code META-INF/persistence.xml} - * resource file - * - * @param daoPersistenceUnit the persistence unit to use for JDBC access - */ - public void setPersistenceUnit(final String daoPersistenceUnit) { - persistenceUnit = daoPersistenceUnit; - } - - /** - * Gets the JDBC properties. - * - * @return the JDBC properties - */ - public Properties getJdbcProperties() { - return jdbcProperties; - } - - /** - * Sets the JDBC properties. - * - * @param jdbcProperties the JDBC properties - */ - public void setJdbcProperties(final Properties jdbcProperties) { - this.jdbcProperties = jdbcProperties; - } - /** * Gets a single JDBC property. * @@ -114,15 +62,4 @@ public class DaoParameters { public void setJdbcProperty(final String key, final String value) { jdbcProperties.setProperty(key, value); } - - /* - * (non-Javadoc) - * - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return "DAOParameters [pluginClass=" + pluginClass + ", persistenceUnit=" + persistenceUnit - + ", jdbcProperties=" + jdbcProperties + "]"; - } } diff --git a/models-dao/src/test/java/org/onap/policy/models/dao/DaoMiscTest.java b/models-dao/src/test/java/org/onap/policy/models/dao/DaoMiscTest.java index 419714924..3a46570a4 100644 --- a/models-dao/src/test/java/org/onap/policy/models/dao/DaoMiscTest.java +++ b/models-dao/src/test/java/org/onap/policy/models/dao/DaoMiscTest.java @@ -1,7 +1,7 @@ /*- * ============LICENSE_START======================================================= * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019, 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. @@ -73,7 +73,7 @@ public class DaoMiscTest { pars.setPluginClass(SOMEWHERE_OVER_THE_RAINBOW); assertEquals(SOMEWHERE_OVER_THE_RAINBOW, pars.getPluginClass()); - assertEquals("DAOParameters [pluginClass=somewhere.over.the.rainbow, " - + "persistenceUnit=Kansas, jdbcProperties={name=Dorothy}]", pars.toString()); + assertEquals("DaoParameters(pluginClass=somewhere.over.the.rainbow, " + + "persistenceUnit=Kansas, jdbcProperties={name=Dorothy})", pars.toString()); } } -- cgit 1.2.3-korg