X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-distributed-datastore%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fmessages%2FCreateTransactionReply.java;h=87dd7c57fb5d8c64cea1d950bc75ec976ab989ab;hb=127042ea7e148d9dc0282acc3780b4754ca69e12;hp=43ce2ec19b40b2f489cfc5f7f9b9046dfc78165e;hpb=24c074a4b32ac97980a652b78824b7c2f97ffb78;p=controller.git diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java index 43ce2ec19b..87dd7c57fb 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/messages/CreateTransactionReply.java @@ -5,61 +5,63 @@ * 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.datastore.messages; -import com.google.common.base.Preconditions; +import static com.google.common.base.Preconditions.checkArgument; +import static java.util.Objects.requireNonNull; + import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; +import org.opendaylight.controller.cluster.access.concepts.TransactionIdentifier; public class CreateTransactionReply extends VersionedExternalizableMessage { private static final long serialVersionUID = 1L; private String transactionPath; - private String transactionId; + private TransactionIdentifier transactionId; public CreateTransactionReply() { } - public CreateTransactionReply(final String transactionPath, final String transactionId, final short version) { + public CreateTransactionReply(final String transactionPath, final TransactionIdentifier transactionId, + final short version) { super(version); - this.transactionPath = transactionPath; - this.transactionId = transactionId; + this.transactionPath = requireNonNull(transactionPath); + this.transactionId = requireNonNull(transactionId); } public String getTransactionPath() { return transactionPath; } - public String getTransactionId() { + public TransactionIdentifier getTransactionId() { return transactionId; } @Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal(in); - transactionId = in.readUTF(); + transactionId = TransactionIdentifier.readFrom(in); transactionPath = in.readUTF(); } @Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); - out.writeUTF(transactionId); + transactionId.writeTo(out); out.writeUTF(transactionPath); } @Override public String toString() { - StringBuilder builder = new StringBuilder(); - builder.append("CreateTransactionReply [transactionPath=").append(transactionPath).append(", transactionId=") - .append(transactionId).append(", version=").append(getVersion()).append("]"); - return builder.toString(); + return "CreateTransactionReply [transactionPath=" + transactionPath + + ", transactionId=" + transactionId + + ", version=" + getVersion() + "]"; } public static CreateTransactionReply fromSerializable(Object serializable) { - Preconditions.checkNotNull(serializable instanceof CreateTransactionReply); + checkArgument(serializable instanceof CreateTransactionReply); return (CreateTransactionReply)serializable; }