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 --- .../src/main/java/org/onap/policy/controlloop/Abated.java | 3 +-- .../org/onap/policy/controlloop/ControlLoopTargetType.java | 12 ++++++------ .../src/main/java/org/onap/policy/controlloop/Onset.java | 3 +-- .../onap/policy/controlloop/PhysicalControlLoopEvent.java | 9 ++++----- .../policy/controlloop/PhysicalControlLoopNotification.java | 9 ++++----- .../java/org/onap/policy/controlloop/util/Serialization.java | 7 +++---- 6 files changed, 19 insertions(+), 24 deletions(-) (limited to 'models-interactions/model-impl/events/src') diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Abated.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Abated.java index 3488e3b6a..f2f879828 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Abated.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Abated.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -33,7 +33,6 @@ public class Abated extends VirtualControlLoopEvent { * No arguments constructor. */ public Abated() { - super(); setClosedLoopEventStatus(ControlLoopEventStatus.ABATED); } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java index 55c133306..18dea09c9 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/ControlLoopTargetType.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,14 +21,14 @@ package org.onap.policy.controlloop; -public class ControlLoopTargetType { +import lombok.AccessLevel; +import lombok.NoArgsConstructor; + +@NoArgsConstructor(access = AccessLevel.PRIVATE) +public final class ControlLoopTargetType { public static final String VM = "VM"; public static final String VF = "VF"; public static final String VFC = "VFC"; public static final String VNF = "VNF"; public static final String PNF = "PNF"; - - private ControlLoopTargetType() { - // do nothing - } } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Onset.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Onset.java index 41a0ebab4..3f427734b 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Onset.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/Onset.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2020-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. @@ -35,7 +35,6 @@ public class Onset extends VirtualControlLoopEvent { * No arguments constructor. */ public Onset() { - super(); setClosedLoopEventStatus(ControlLoopEventStatus.ONSET); } diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopEvent.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopEvent.java index 17a23b749..e7cf7e33b 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopEvent.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopEvent.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,13 +21,12 @@ package org.onap.policy.controlloop; +import lombok.NoArgsConstructor; + +@NoArgsConstructor public class PhysicalControlLoopEvent extends ControlLoopEvent { private static final long serialVersionUID = -7282930271094849487L; - public PhysicalControlLoopEvent() { - // Default constructor - } - /** * Construct an instance from an existing instance. * diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopNotification.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopNotification.java index 12c28c761..3290fb952 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopNotification.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopNotification.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * controlloop * ================================================================================ - * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019, 2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,13 +21,12 @@ package org.onap.policy.controlloop; +import lombok.NoArgsConstructor; + +@NoArgsConstructor public class PhysicalControlLoopNotification extends ControlLoopNotification { private static final long serialVersionUID = 8105197217140032892L; - public PhysicalControlLoopNotification() { - // Default constructor - } - /** * Construct an instance from an existing instance. * diff --git a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java index 5f124131e..9b70ab86c 100644 --- a/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java +++ b/models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java @@ -33,10 +33,13 @@ import java.lang.reflect.Type; import java.time.Instant; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import lombok.AccessLevel; +import lombok.NoArgsConstructor; import org.onap.policy.common.gson.InstantAsMillisTypeAdapter; import org.onap.policy.common.gson.ZonedDateTimeTypeAdapter; import org.onap.policy.controlloop.ControlLoopNotificationType; +@NoArgsConstructor(access = AccessLevel.PRIVATE) public final class Serialization { public static final DateTimeFormatter format = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSSSSSxxx"); @@ -54,10 +57,6 @@ public final class Serialization { .registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeTypeAdapter(format)) .registerTypeAdapter(Instant.class, new InstantAsMillisTypeAdapter()).create(); - private Serialization() { - // Private constructor to prevent subclassing - } - public static class NotificationTypeAdapter implements JsonSerializer, JsonDeserializer { @Override -- cgit 1.2.3-korg