MessageParts should be a class 82/101882/1
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jul 2022 18:00:15 +0000 (20:00 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jul 2022 18:16:45 +0000 (20:16 +0200)
Using interface to hold constants is an antipattern, ditch it.

Change-Id: I4b77c5d1ca6021f4381a17245ac3286ea36a08ac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/MessageParts.java

index 3db8ca6af093fa74807e7cba74f68353b66831fd..a077671c7f22591bc49a567ddc820ce9af0fbed4 100644 (file)
@@ -16,8 +16,12 @@ import org.opendaylight.netconf.util.messages.NetconfMessageConstants;
  *
  * @author Thomas Pantelis
  */
-interface MessageParts {
-    byte[] END_OF_MESSAGE = NetconfMessageConstants.END_OF_MESSAGE.getBytes(UTF_8);
-    byte[] START_OF_CHUNK = NetconfMessageConstants.START_OF_CHUNK.getBytes(UTF_8);
-    byte[] END_OF_CHUNK = NetconfMessageConstants.END_OF_CHUNK.getBytes(UTF_8);
+final class MessageParts {
+    static final byte[] END_OF_MESSAGE = NetconfMessageConstants.END_OF_MESSAGE.getBytes(UTF_8);
+    static final byte[] START_OF_CHUNK = NetconfMessageConstants.START_OF_CHUNK.getBytes(UTF_8);
+    static final byte[] END_OF_CHUNK = NetconfMessageConstants.END_OF_CHUNK.getBytes(UTF_8);
+
+    private MessageParts() {
+        // Hidden on purpose
+    }
 }