Check rc:yang-data template name duplications
[yangtools.git] / codec / yang-data-codec-binfmt / src / main / java / org / opendaylight / yangtools / yang / data / codec / binfmt / LithiumNormalizedNodeInputStreamReader.java
1 /*
2  * Copyright (c) 2014, 2015 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.yangtools.yang.data.codec.binfmt;
9
10 import com.google.common.base.Strings;
11 import java.io.DataInput;
12 import java.io.IOException;
13 import org.opendaylight.yangtools.yang.common.QName;
14 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
15
16 /**
17  * Lithium (or Oxygen really) specialization of AbstractLithiumDataInput.
18  */
19 final class LithiumNormalizedNodeInputStreamReader extends AbstractLithiumDataInput {
20     LithiumNormalizedNodeInputStreamReader(final DataInput input) {
21         super(input);
22     }
23
24     @Override
25     @Deprecated(since = "11.0.0", forRemoval = true)
26     public NormalizedNodeStreamVersion getVersion() {
27         return NormalizedNodeStreamVersion.LITHIUM;
28     }
29
30     @Override
31     public QName readQName() throws IOException {
32         // Read in the same sequence of writing
33         String localName = readCodedString();
34         String namespace = readCodedString();
35         String revision = Strings.emptyToNull(readCodedString());
36
37         return QNameFactory.create(localName, namespace, revision);
38     }
39
40     @Override
41     LegacyAugmentationIdentifier readAugmentationIdentifier() throws IOException {
42         return defaultReadAugmentationIdentifier();
43     }
44
45     @Override
46     NodeIdentifier readNodeIdentifier() throws IOException {
47         return new NodeIdentifier(readQName());
48     }
49 }