aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-impl
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2019-12-10 13:57:32 +0000
committerliamfallon <liam.fallon@est.tech>2019-12-10 13:57:37 +0000
commit5a366fdab88b7205cedd2ba687109b80dc374544 (patch)
tree26a98347ddfe39c2c20fad20a487014c1a0f2263 /models-interactions/model-impl
parentdb85df62efbf70597d9f7e965f68b77f4ddc1f1f (diff)
Fix minor checksyle issues in models
New checkstyle profile flagged some minor issues in policy models. Issue-ID: POLICY-2165 Change-Id: I17ed070a3d55601ad31e48fdfd29fff01d29fa42 Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'models-interactions/model-impl')
-rw-r--r--models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java8
-rw-r--r--models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java5
-rw-r--r--models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java4
-rw-r--r--models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java2
-rw-r--r--models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/util/Serialization.java8
-rw-r--r--models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopEvent.java4
-rw-r--r--models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/PhysicalControlLoopNotification.java4
-rw-r--r--models-interactions/model-impl/events/src/main/java/org/onap/policy/controlloop/util/Serialization.java14
-rw-r--r--models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java2
-rw-r--r--models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java5
-rw-r--r--models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcHealActionVmInfo.java3
11 files changed, 33 insertions, 26 deletions
diff --git a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java
index 75cafd1b4..e42325f4a 100644
--- a/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java
+++ b/models-interactions/model-impl/aai/src/main/java/org/onap/policy/aai/util/Serialization.java
@@ -26,9 +26,9 @@ import com.google.gson.GsonBuilder;
public final class Serialization {
- public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
- .create();
-
- private Serialization() {}
+ public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
+ private Serialization() {
+ // Private constructor to prevent subclassing
+ }
}
diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java
index 05507e60e..f0419efe9 100644
--- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java
+++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/CommonHeader.java
@@ -29,6 +29,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;
import java.util.UUID;
+
import lombok.Getter;
import lombok.Setter;
@@ -58,7 +59,9 @@ public class CommonHeader implements Serializable {
@SerializedName("Flags")
private Collection<Map<String, String>> flags = new ArrayList<>();
- public CommonHeader() {}
+ public CommonHeader() {
+ // Default constructor
+ }
/**
* Construct an instance from an existing instance.
diff --git a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java
index 735fb6234..30d4fcb0a 100644
--- a/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java
+++ b/models-interactions/model-impl/appc/src/main/java/org/onap/policy/appc/util/Serialization.java
@@ -48,7 +48,9 @@ public final class Serialization {
// .registerTypeAdapter(ResponseStatus1607.class, new gsonResponseStatus())
.create();
- private Serialization() {}
+ private Serialization() {
+ // Private constructor to prevent subclassing
+ }
public static class GsonUtcAdapter implements JsonSerializer<ZonedDateTime>, JsonDeserializer<ZonedDateTime> {
private static final Logger logger = LoggerFactory.getLogger(GsonUtcAdapter.class);
diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java
index 00ac99de5..3e09bec0a 100644
--- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java
+++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java
@@ -22,10 +22,8 @@
package org.onap.policy.appc;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import java.util.HashMap;
import java.util.Map;
diff --git a/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/util/Serialization.java b/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/util/Serialization.java
index 9b522f323..11da28a36 100644
--- a/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/util/Serialization.java
+++ b/models-interactions/model-impl/appclcm/src/main/java/org/onap/policy/appclcm/util/Serialization.java
@@ -37,13 +37,15 @@ public final class Serialization {
public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(Instant.class, new InstantAdapter()).create();
- public static final Gson gson = new GsonBuilder().disableHtmlEscaping()
- .registerTypeAdapter(Instant.class, new InstantAdapter()).create();
+ public static final Gson gson =
+ new GsonBuilder().disableHtmlEscaping().registerTypeAdapter(Instant.class, new InstantAdapter()).create();
public static final Gson gsonJunit = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(Instant.class, new InstantJunitAdapter()).create();
- private Serialization() {}
+ private Serialization() {
+ // Private constructor to prevent subclassing
+ }
public static class InstantAdapter implements JsonSerializer<Instant>, JsonDeserializer<Instant> {
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 7848d613a..17a23b749 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
@@ -24,7 +24,9 @@ package org.onap.policy.controlloop;
public class PhysicalControlLoopEvent extends ControlLoopEvent {
private static final long serialVersionUID = -7282930271094849487L;
- public PhysicalControlLoopEvent() {}
+ 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 168f97c86..12c28c761 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
@@ -24,7 +24,9 @@ package org.onap.policy.controlloop;
public class PhysicalControlLoopNotification extends ControlLoopNotification {
private static final long serialVersionUID = 8105197217140032892L;
- public PhysicalControlLoopNotification() {}
+ 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 96797ed00..0b94e854f 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
@@ -43,22 +43,20 @@ public final class Serialization {
public static final Gson gson =
new GsonBuilder().disableHtmlEscaping().registerTypeAdapter(ZonedDateTime.class, new GsonUtcAdapter())
.registerTypeAdapter(Instant.class, new GsonInstantAdapter())
- .registerTypeAdapter(ControlLoopNotificationType.class, new NotificationTypeAdapter())
- .create();
-
+ .registerTypeAdapter(ControlLoopNotificationType.class, new NotificationTypeAdapter()).create();
public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(ZonedDateTime.class, new GsonUtcAdapter())
.registerTypeAdapter(Instant.class, new GsonInstantAdapter())
- .registerTypeAdapter(ControlLoopNotificationType.class, new NotificationTypeAdapter())
- .create();
+ .registerTypeAdapter(ControlLoopNotificationType.class, new NotificationTypeAdapter()).create();
public static final Gson gsonJunit = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(ZonedDateTime.class, new GsonUtcAdapter())
- .registerTypeAdapter(Instant.class, new GsonInstantAdapter())
- .create();
+ .registerTypeAdapter(Instant.class, new GsonInstantAdapter()).create();
- private Serialization() {}
+ private Serialization() {
+ // Private constructor to prevent subclassing
+ }
public static class NotificationTypeAdapter
implements JsonSerializer<ControlLoopNotificationType>, JsonDeserializer<ControlLoopNotificationType> {
diff --git a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java
index cfdc859b1..8579bf1bd 100644
--- a/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java
+++ b/models-interactions/model-impl/rest/src/test/java/org/onap/policy/rest/HttpDeleteWithBodyTest.java
@@ -30,7 +30,7 @@ public class HttpDeleteWithBodyTest {
private static final String NO_URI = "BlahBlah";
@Test
- public void getMethod() {
+ public void testGetMethod() {
HttpDeleteWithBody deleteWithBody = new HttpDeleteWithBody(NO_URI);
assertEquals("DELETE", deleteWithBody.getMethod());
assertEquals(NO_URI, deleteWithBody.getURI().toString());
diff --git a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java
index 31af9468a..7640242e7 100644
--- a/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java
+++ b/models-interactions/model-impl/sdnr/src/main/java/org/onap/policy/sdnr/util/Serialization.java
@@ -38,7 +38,6 @@ import java.time.Instant;
import org.onap.policy.sdnr.PciRequest;
import org.onap.policy.sdnr.PciResponse;
-
public final class Serialization {
public static final Gson gsonPretty = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(Instant.class, new InstantAdapter()).create();
@@ -50,7 +49,9 @@ public final class Serialization {
public static final Gson gsonJunit = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting()
.registerTypeAdapter(Instant.class, new InstantJunitAdapter()).create();
- private Serialization() {}
+ private Serialization() {
+ // Private constructor to prevent subclassing
+ }
public static class RequestAdapter implements JsonSerializer<PciRequest>, JsonDeserializer<PciRequest> {
diff --git a/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcHealActionVmInfo.java b/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcHealActionVmInfo.java
index 1485b6a04..c7e44d930 100644
--- a/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcHealActionVmInfo.java
+++ b/models-interactions/model-impl/vfc/src/main/java/org/onap/policy/vfc/VfcHealActionVmInfo.java
@@ -20,9 +20,8 @@
package org.onap.policy.vfc;
-import com.google.gson.annotations.SerializedName;
-
import java.io.Serializable;
+
import lombok.Getter;
import lombok.Setter;