Fixed bugs in naming conventions of packages.
[controller.git] / opendaylight / sal / yang-prototype / yang / yang-model-util / src / main / java / org / opendaylight / controller / yang / model / util / BaseTypes.java
1 /*
2  * Copyright (c) 2013 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.yang.model.util;
9
10 import java.net.URI;
11 import java.util.ArrayList;
12 import java.util.List;
13
14 import org.opendaylight.controller.yang.common.QName;
15 import org.opendaylight.controller.yang.model.api.SchemaPath;
16
17 public final class BaseTypes {
18
19     private BaseTypes() {}
20
21     public static final URI BaseTypesNamespace = URI
22             .create("urn:ietf:params:xml:ns:yang:1");
23
24     /**
25      * Construct QName for Built-in base Yang type. The namespace for
26      * built-in base yang types is defined as: urn:ietf:params:xml:ns:yang:1
27      * 
28      * @param typeName yang type name
29      * @return built-in base yang type QName.
30      */
31     public static final QName constructQName(final String typeName) {
32         return new QName(BaseTypesNamespace, typeName);
33     }
34
35     /**
36      * Creates Schema Path from Qname.
37      * 
38      * @param typeName yang type QName
39      * @return Schema Path from Qname.
40      */
41     public static final SchemaPath schemaPath(final QName typeName) {
42         final List<QName> pathList = new ArrayList<QName>();
43         pathList.add(typeName);
44         return new SchemaPath(pathList, true);
45     }
46 }