Remove NormalizedNodeOutputStreamWriter
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / test / java / org / opendaylight / controller / cluster / datastore / node / utils / stream / SampleNormalizedNodeSerializable.java
1 /*
2  * Copyright (c) 2014 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
9 package org.opendaylight.controller.cluster.datastore.node.utils.stream;
10
11 import java.io.IOException;
12 import java.io.ObjectInputStream;
13 import java.io.ObjectOutputStream;
14 import java.io.Serializable;
15 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
16
17 public class SampleNormalizedNodeSerializable implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private NormalizedNode<?, ?> input;
21
22     public SampleNormalizedNodeSerializable(final NormalizedNode<?, ?> input) {
23         this.input = input;
24     }
25
26     public NormalizedNode<?, ?> getInput() {
27         return input;
28     }
29
30     private void readObject(final ObjectInputStream stream) throws IOException {
31         this.input = NormalizedNodeInputOutput.newDataInput(stream).readNormalizedNode();
32     }
33
34     private void writeObject(final ObjectOutputStream stream) throws IOException {
35         NormalizedNodeInputOutput.newDataOutput(stream).writeNormalizedNode(input);
36     }
37
38 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.