Remove legacy raft.persisted proxies
[controller.git] / opendaylight / md-sal / sal-akka-raft / src / main / java / org / opendaylight / controller / cluster / raft / persisted / UpdateElectionTerm.java
index 99b3b61bad920221959079f2cb101093d071e3d9..3ef7acbea369c35f4fa365ac5736aa0b3f34df7f 100644 (file)
@@ -7,57 +7,12 @@
  */
 package org.opendaylight.controller.cluster.raft.persisted;
 
-import java.io.Externalizable;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
 import java.io.Serializable;
 
 /**
  * Message class to persist election term information.
  */
-public sealed class UpdateElectionTerm implements Serializable {
-    @Deprecated(since = "7.0.0", forRemoval = true)
-    private static final class Legacy extends UpdateElectionTerm implements LegacySerializable {
-        @java.io.Serial
-        private static final long serialVersionUID = 1L;
-
-        Legacy(final long currentTerm, final String votedFor) {
-            super(currentTerm, votedFor);
-        }
-    }
-
-    @Deprecated(since = "7.0.0", forRemoval = true)
-    private static final class Proxy implements Externalizable {
-        @java.io.Serial
-        private static final long serialVersionUID = 1L;
-
-        private UpdateElectionTerm updateElectionTerm = null;
-
-        // checkstyle flags the public modifier as redundant which really doesn't make sense since it clearly isn't
-        // redundant. It is explicitly needed for Java serialization to be able to create instances via reflection.
-        @SuppressWarnings("checkstyle:RedundantModifier")
-        public Proxy() {
-            // For Externalizable
-        }
-
-        @Override
-        public void writeExternal(final ObjectOutput out) throws IOException {
-            out.writeLong(updateElectionTerm.currentTerm);
-            out.writeObject(updateElectionTerm.votedFor);
-        }
-
-        @Override
-        public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
-            updateElectionTerm = new Legacy(in.readLong(), (String) in.readObject());
-        }
-
-        @java.io.Serial
-        private Object readResolve() {
-            return updateElectionTerm;
-        }
-    }
-
+public final class UpdateElectionTerm implements Serializable {
     @java.io.Serial
     private static final long serialVersionUID = 1L;
 
@@ -69,22 +24,22 @@ public sealed class UpdateElectionTerm implements Serializable {
         this.votedFor = votedFor;
     }
 
-    public final long getCurrentTerm() {
+    public long getCurrentTerm() {
         return currentTerm;
     }
 
-    public final String getVotedFor() {
+    public String getVotedFor() {
         return votedFor;
     }
 
-    @java.io.Serial
-    public final Object writeReplace() {
-        return new UT(this);
-    }
-
     @Override
-    public final String toString() {
+    public String toString() {
         return "UpdateElectionTerm [currentTerm=" + currentTerm + ", votedFor=" + votedFor + "]";
     }
+
+    @java.io.Serial
+    private Object writeReplace() {
+        return new UT(this);
+    }
 }