X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fconcepts%2FLocalHistoryIdentifier.java;fp=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fconcepts%2FLocalHistoryIdentifier.java;h=e6050e76c5055f5517d1fef7674a27b269147121;hp=137bf5907f3ca985170f482d49ae48d86debbc56;hb=17072677c1de88e6864ae8828efd7b2f9037ef21;hpb=6dae46fa18d67b5f5257f6ae280120203f4ab42e diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java index 137bf5907f..e6050e76c5 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/concepts/LocalHistoryIdentifier.java @@ -16,6 +16,7 @@ import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; +import java.io.Serial; import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yangtools.concepts.WritableIdentifier; import org.opendaylight.yangtools.concepts.WritableObjects; @@ -25,8 +26,6 @@ import org.opendaylight.yangtools.concepts.WritableObjects; * - a {@link ClientIdentifier}, which uniquely identifies a single instantiation of a particular frontend * - an unsigned long, which uniquely identifies the history on the backend * - an unsigned long cookie, assigned by the client and meaningless on the backend, which just reflects it back - * - * @author Robert Varga */ public final class LocalHistoryIdentifier implements WritableIdentifier { /* @@ -39,7 +38,9 @@ public final class LocalHistoryIdentifier implements WritableIdentifier { * compatibility. */ private static final class Proxy implements Externalizable { + @Serial private static final long serialVersionUID = 1L; + private ClientIdentifier clientId; private long historyId; private long cookie; @@ -72,12 +73,15 @@ public final class LocalHistoryIdentifier implements WritableIdentifier { cookie = WritableObjects.readSecondLong(in, header); } + @Serial private Object readResolve() { return new LocalHistoryIdentifier(clientId, historyId, cookie); } } + @Serial private static final long serialVersionUID = 1L; + private final @NonNull ClientIdentifier clientId; private final long historyId; private final long cookie; @@ -131,11 +135,10 @@ public final class LocalHistoryIdentifier implements WritableIdentifier { if (this == obj) { return true; } - if (!(obj instanceof LocalHistoryIdentifier)) { + if (!(obj instanceof LocalHistoryIdentifier other)) { return false; } - final LocalHistoryIdentifier other = (LocalHistoryIdentifier) obj; return historyId == other.historyId && cookie == other.cookie && clientId.equals(other.clientId); } @@ -146,6 +149,7 @@ public final class LocalHistoryIdentifier implements WritableIdentifier { .add("cookie", Long.toUnsignedString(cookie, 16)).toString(); } + @Serial private Object writeReplace() { return new Proxy(clientId, historyId, cookie); }