Bug 2003: CDS serialization improvements
[controller.git] / opendaylight / md-sal / sal-clustering-commons / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / serialization / QNameDeSerializationContextImpl.java
1 /*
2  * Copyright (c) 2014 Brocade Communications 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.datastore.node.utils.serialization;
9
10 import java.util.List;
11
12 /**
13  * Implementation of the QNameDeSerializationContext interface.
14  *
15  * @author Thomas Pantelis
16  */
17 public class QNameDeSerializationContextImpl implements QNameDeSerializationContext {
18
19     private final List<String> codeList;
20
21     public QNameDeSerializationContextImpl(List<String> codeList) {
22         this.codeList = codeList;
23     }
24
25     @Override
26     public String getNamespace(int namespace) {
27         return codeList.get(namespace);
28     }
29
30     @Override
31     public String getRevision(int revision) {
32         return codeList.get(revision);
33     }
34
35     @Override
36     public String getLocalName(int localName) {
37         return codeList.get(localName);
38     }
39 }