BUG-5626: make CloseTransactionChain implement Identifiable
[controller.git] / opendaylight / md-sal / cds-access-api / src / main / java / org / opendaylight / controller / cluster / access / concepts / WritableObject.java
1 /*
2  * Copyright (c) 2016 Cisco 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.access.concepts;
9
10 import com.google.common.annotations.Beta;
11 import java.io.DataOutput;
12 import java.io.IOException;
13 import javax.annotation.Nonnull;
14
15 /**
16  * Marker interface for an object which can be written out to an {@link DataOutput}. Classes implementing this
17  * interface should declare a corresponding
18  *
19  * <pre>
20  *      public static CLASS readFrom(DataInput in) throws IOException;
21  * </pre>
22  *
23  * The serialization format provided by this abstraction does not guarantee versioning. Callers are responsible for
24  * ensuring the source stream is correctly positioned.
25  *
26  * @author Robert Varga
27  */
28 // FIXME: this really should go into yangtools/common/concepts.
29 @Beta
30 public interface WritableObject {
31     /**
32      * Serialize this object into a {@link DataOutput} as a fixed-format stream.
33      *
34      * @param out Output
35      * @throws IOException if the output fails
36      * @throws NullPointerException if out is null
37      */
38     void writeTo(@Nonnull DataOutput out) throws IOException;
39 }