2 * Copyright (c) 2016 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
8 package org.opendaylight.controller.cluster.access.concepts;
10 import com.google.common.annotations.Beta;
11 import java.io.DataOutput;
12 import java.io.IOException;
13 import javax.annotation.Nonnull;
16 * Marker interface for an object which can be written out to an {@link DataOutput}. Classes implementing this
17 * interface should declare a corresponding
20 * public static CLASS readFrom(DataInput in) throws IOException;
23 * The serialization format provided by this abstraction does not guarantee versioning. Callers are responsible for
24 * ensuring the source stream is correctly positioned.
26 * @author Robert Varga
28 // FIXME: this really should go into yangtools/common/concepts.
30 public interface WritableObject {
32 * Serialize this object into a {@link DataOutput} as a fixed-format stream.
35 * @throws IOException if the output fails
36 * @throws NullPointerException if out is null
38 void writeTo(@Nonnull DataOutput out) throws IOException;