Bug 2597: Batch modification operations in TransactionProxy
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / messages / EmptyReply.java
1 /*
2  * Copyright (c) 2015 Brocade Communications Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.datastore.messages;
9
10 import org.opendaylight.controller.cluster.datastore.DataStoreVersions;
11
12 /**
13  * A reply with no data.
14  *
15  * @author Thomas Pantelis
16  */
17 public abstract class EmptyReply extends EmptyExternalizable {
18
19     private final Object legacySerializedInstance;
20
21     protected EmptyReply(Object legacySerializedInstance) {
22         super();
23         this.legacySerializedInstance = legacySerializedInstance;
24     }
25
26     public Object toSerializable(short toVersion) {
27         return toVersion >= DataStoreVersions.LITHIUM_VERSION ? this : legacySerializedInstance;
28     }
29 }