Remove deprecated Helium Payload methods
[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 VersionedExternalizableMessage {
18     protected EmptyReply() {
19     }
20
21     protected EmptyReply(short version) {
22         super(version);
23     }
24
25     protected abstract Object newLegacySerializedInstance();
26
27     @Override
28     public Object toSerializable() {
29         return getVersion() >= DataStoreVersions.BORON_VERSION ? this : newLegacySerializedInstance();
30     }
31
32     @Override
33     public String toString() {
34         return getClass().getSimpleName() + " [version=" + getVersion() + "]";
35     }
36 }