X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FHF.java;fp=opendaylight%2Fmd-sal%2Fcds-access-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Faccess%2Fcommands%2FHF.java;h=68e9b09b48f031f3073c4a7da4e87786c83e2e36;hb=d92bd0e575983b3d6a09a73089ef8f9c62f94eaa;hp=0000000000000000000000000000000000000000;hpb=e085f22bb1934959f9d6f7f4368c1afe964b1e07;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/HF.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/HF.java new file mode 100644 index 0000000000..68e9b09b48 --- /dev/null +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/HF.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022 PANTHEON.tech, s.r.o. and others. All rights reserved. + * + * This program and the accompanying materials are made available under the + * 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.access.commands; + +import static com.google.common.base.Verify.verifyNotNull; +import static java.util.Objects.requireNonNull; + +/** + * Externalizable proxy for use with {@link LocalHistoryFailure}. It implements the Chlorine SR2 serialization format. + */ +final class HF implements LocalHistoryFailure.SerialForm { + @java.io.Serial + private static final long serialVersionUID = 1L; + + private LocalHistoryFailure message; + + @SuppressWarnings("checkstyle:RedundantModifier") + public HF() { + // for Externalizable + } + + HF(final LocalHistoryFailure message) { + this.message = requireNonNull(message); + } + + @Override + public LocalHistoryFailure message() { + return verifyNotNull(message); + } + + @Override + public void setMessage(final LocalHistoryFailure message) { + this.message = requireNonNull(message); + } + + @Override + public Object readResolve() { + return message(); + } +}