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%2FPersistenceProtocol.java;h=82fca03087c6ac794caa188cd2928c989015af71;hb=HEAD;hp=be58b05b1fc87f3f3cdceb6f9ef6271dd210fbd8;hpb=d51fa94a802a2ce48b06550f78bb73d61fadb095;p=controller.git diff --git a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PersistenceProtocol.java b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PersistenceProtocol.java index be58b05b1f..82fca03087 100644 --- a/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PersistenceProtocol.java +++ b/opendaylight/md-sal/cds-access-api/src/main/java/org/opendaylight/controller/cluster/access/commands/PersistenceProtocol.java @@ -7,19 +7,16 @@ */ package org.opendaylight.controller.cluster.access.commands; -import com.google.common.annotations.Beta; import java.io.DataInput; import java.io.DataOutput; import java.io.IOException; +import org.eclipse.jdt.annotation.Nullable; import org.opendaylight.yangtools.concepts.WritableObject; /** * Enumeration of transaction persistence protocols. These govern which protocol is executed between the frontend * and backend to drive persistence of a particular transaction. - * - * @author Robert Varga */ -@Beta public enum PersistenceProtocol implements WritableObject { /** * Abort protocol. The transaction has been aborted on the frontend and its effects should not be visible @@ -77,20 +74,14 @@ public enum PersistenceProtocol implements WritableObject { return finish == null ? 0 : finish.byteValue(); } - static PersistenceProtocol valueOf(final byte value) { - switch (value) { - case 0: - return null; - case 1: - return ABORT; - case 2: - return SIMPLE; - case 3: - return THREE_PHASE; - case 4: - return READY; - default: - throw new IllegalArgumentException("Unhandled byte value " + value); - } + static @Nullable PersistenceProtocol valueOf(final byte value) { + return switch (value) { + case 0 -> null; + case 1 -> ABORT; + case 2 -> SIMPLE; + case 3 -> THREE_PHASE; + case 4 -> READY; + default -> throw new IllegalArgumentException("Unhandled byte value " + value); + }; } }