-public sealed class SimpleReplicatedLogEntry implements ReplicatedLogEntry, Serializable {
- @Deprecated(since = "7.0.0", forRemoval = true)
- private static final class Legacy extends SimpleReplicatedLogEntry implements LegacySerializable {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- Legacy(final long index, final long term, final Payload payload) {
- super(index, term, payload);
- }
- }
-
- @Deprecated(since = "7.0.0", forRemoval = true)
- private static final class Proxy implements Externalizable {
- @java.io.Serial
- private static final long serialVersionUID = 1L;
-
- private long index;
- private long term;
- private Payload data;
-
- // 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(index);
- out.writeLong(term);
- out.writeObject(data);
- }
-
- @Override
- public void readExternal(final ObjectInput in) throws IOException, ClassNotFoundException {
- index = in.readLong();
- term = in.readLong();
- data = (Payload) in.readObject();
- }
-
- @java.io.Serial
- private Object readResolve() {
- return new Legacy(index, term, data);
- }
- }
-