Enable checkstyle
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / messages / AbstractRaftRPC.java
index 33d8a6868680e03e09155332fc89b6089231bd19..038ad48b8e4aa0cae2778a3e0fce110a55d44a6f 100644 (file)
@@ -5,26 +5,25 @@
  * 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.controller.cluster.raft.messages;
 
-public class AbstractRaftRPC implements RaftRPC {
+public abstract class AbstractRaftRPC implements RaftRPC {
+    @java.io.Serial
+    private static final long serialVersionUID = -6061342433962854822L;
+
     // term
-    protected long term;
+    private final long term;
 
-    protected AbstractRaftRPC(long term){
+    AbstractRaftRPC(final long term) {
         this.term = term;
     }
 
-    // added for testing while serialize-messages=on
-    public AbstractRaftRPC() {
-    }
-
-    public long getTerm() {
+    @Override
+    public final long getTerm() {
         return term;
     }
 
-    public void setTerm(long term) {
-        this.term = term;
-    }
+    // All implementations must use Externalizable Proxy pattern
+    @java.io.Serial
+    abstract Object writeReplace();
 }