Turn NetconfMessageConstants into a final class 84/101884/2
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jul 2022 18:24:50 +0000 (20:24 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 28 Jul 2022 20:27:24 +0000 (22:27 +0200)
Keeping constants in an interface is an antipattern, correct that.

Change-Id: I71a49126ec05107dc09ff05e47d16ba461d92e9d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-util/src/main/java/org/opendaylight/netconf/util/messages/NetconfMessageConstants.java

index df5b4bc8d320af34d6444d3352b9a53a357341d0..db2387530d04ecb34d70261ad2c737fe07d775d6 100644 (file)
@@ -5,25 +5,29 @@
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
  * and is available at http://www.eclipse.org/legal/epl-v10.html
  */
-
 package org.opendaylight.netconf.util.messages;
 
-public interface NetconfMessageConstants {
+import org.eclipse.jdt.annotation.NonNullByDefault;
 
+@NonNullByDefault
+public final class NetconfMessageConstants {
     /**
-     * The NETCONF 1.0 old-style message separator. This is framing mechanism
-     * is used by default.
+     * The NETCONF 1.0 old-style message separator. This is framing mechanism is used by default.
      */
-    String END_OF_MESSAGE = "]]>]]>";
+    public static final String END_OF_MESSAGE = "]]>]]>";
 
     // bytes
-
-    int MIN_HEADER_LENGTH = 4;
+    @Deprecated(since = "3.0.6", forRemoval = true)
+    public static final int MIN_HEADER_LENGTH = 4;
 
     // bytes
+    @Deprecated(since = "3.0.6", forRemoval = true)
+    public static final int MAX_HEADER_LENGTH = 13;
 
-    int MAX_HEADER_LENGTH = 13;
+    public static final String START_OF_CHUNK = "\n#";
+    public static final String END_OF_CHUNK = "\n##\n";
 
-    String START_OF_CHUNK = "\n#";
-    String END_OF_CHUNK = "\n##\n";
+    private NetconfMessageConstants() {
+        // Hidden on purpose
+    }
 }