X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fbinding-generator-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fyang%2Ftypes%2FBaseYangTypes.java;fp=opendaylight%2Fsal%2Fyang-prototype%2Fcode-generator%2Fbinding-generator-impl%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fbinding%2Fyang%2Ftypes%2FBaseYangTypes.java;h=0000000000000000000000000000000000000000;hp=38486e73f9871e6646128afb5be2c105dbc53cad;hb=29766fa9b1eb9b23162a4dcb485a5d921b9471bc;hpb=97d2f10bea5bdd773453bc7202b9dd04f4b70c3b diff --git a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java b/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java deleted file mode 100644 index 38486e73f9..0000000000 --- a/opendaylight/sal/yang-prototype/code-generator/binding-generator-impl/src/main/java/org/opendaylight/controller/sal/binding/yang/types/BaseYangTypes.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0 which accompanies this distribution, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ -package org.opendaylight.controller.sal.binding.yang.types; - -import java.math.BigInteger; -import java.util.HashMap; -import java.util.Map; - -import org.opendaylight.controller.binding.generator.util.Types; -import org.opendaylight.controller.sal.binding.generator.spi.TypeProvider; -import org.opendaylight.controller.sal.binding.model.api.Type; -import org.opendaylight.yangtools.yang.model.api.TypeDefinition; - -public final class BaseYangTypes { - - private static Map typeMap = new HashMap(); - - public static final Type BOOLEAN_TYPE = Types.typeForClass(Boolean.class); - public static final Type EMPTY_TYPE = Types.typeForClass(Boolean.class); - public static final Type INT8_TYPE = Types.typeForClass(Byte.class); - public static final Type INT16_TYPE = Types.typeForClass(Short.class); - public static final Type INT32_TYPE = Types.typeForClass(Integer.class); - public static final Type INT64_TYPE = Types.typeForClass(Long.class); - public static final Type STRING_TYPE = Types.typeForClass(String.class); - public static final Type DECIMAL64_TYPE = Types.typeForClass(Double.class); - public static final Type UINT8_TYPE = Types.typeForClass(Short.class); - public static final Type UINT16_TYPE = Types.typeForClass(Integer.class); - public static final Type UINT32_TYPE = Types.typeForClass(Long.class); - public static final Type UINT64_TYPE = Types.typeForClass(BigInteger.class); - public static final Type BINARY_TYPE = Types.primitiveType("byte[]"); - - static { - typeMap.put("boolean", BOOLEAN_TYPE); - typeMap.put("empty", EMPTY_TYPE); - typeMap.put("int8", INT8_TYPE); - typeMap.put("int16", INT16_TYPE); - typeMap.put("int32", INT32_TYPE); - typeMap.put("int64", INT64_TYPE); - typeMap.put("string", STRING_TYPE); - typeMap.put("decimal64", DECIMAL64_TYPE); - typeMap.put("uint8", UINT8_TYPE); - typeMap.put("uint16", UINT16_TYPE); - typeMap.put("uint32", UINT32_TYPE); - typeMap.put("uint64", UINT64_TYPE); - typeMap.put("binary", BINARY_TYPE); - } - - public static final TypeProvider BASE_YANG_TYPES_PROVIDER = new TypeProvider() { - - @Override - public Type javaTypeForYangType(String type) { - return typeMap.get(type); - } - - @Override - public Type javaTypeForSchemaDefinitionType(TypeDefinition type) { - if (type != null) { - return typeMap.get(type.getQName().getLocalName()); - } - - return null; - } - }; -}