Merge "Bug 1305: Review YangTools grammar"
[yangtools.git] / yang / yang-model-util / src / main / java / org / opendaylight / yangtools / yang / model / util / YangTypesConverter.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.yangtools.yang.model.util;
9
10 import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
11
12 /**
13  * Utility class which provides various helper methods for working with YANG
14  * built-in types.
15  *
16  * @deprecated Use {@link BaseTypes} instead.
17  */
18 @Deprecated
19 public final class YangTypesConverter {
20     /**
21      * It isn't desirable to create the instances of this class
22      */
23     private YangTypesConverter() {
24     }
25
26     @Deprecated
27     public static boolean isBaseYangType(final String type) {
28         return BaseTypes.isYangBuildInType(type);
29     }
30
31     /**
32      *
33      * Returns default instance of built-in type for supplied string.
34      *
35      * @param typeName
36      * @return default instance of built-in type for supplied string or null, if
37      *         default instance does not exist.
38      *
39      * @deprecated Use {@link BaseTypes#defaultBaseTypeFor(String)} instead.
40      */
41     @Deprecated
42     public static TypeDefinition<?> javaTypeForBaseYangType(final String typeName) {
43         return BaseTypes.defaultBaseTypeFor(typeName).orNull();
44     }
45
46 }