2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
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
9 package org.opendaylight.controller.cluster.datastore.messages;
11 import com.google.common.base.Preconditions;
12 import java.io.IOException;
13 import java.io.ObjectInput;
14 import java.io.ObjectOutput;
16 public class DataExistsReply extends VersionedExternalizableMessage {
17 private static final long serialVersionUID = 1L;
19 private boolean exists;
21 public DataExistsReply() {
24 public DataExistsReply(final boolean exists, final short version) {
29 public boolean exists() {
34 public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
35 super.readExternal(in);
36 exists = in.readBoolean();
40 public void writeExternal(ObjectOutput out) throws IOException {
41 super.writeExternal(out);
42 out.writeBoolean(exists);
45 public static DataExistsReply fromSerializable(final Object serializable) {
46 Preconditions.checkArgument(serializable instanceof DataExistsReply);
47 return (DataExistsReply)serializable;
50 public static boolean isSerializedType(Object message) {
51 return message instanceof DataExistsReply;