@Test public void testForTypeDef() throws DataModelException { test = getJavaImportPackage(getStubExtendedInfo(getStubYangType(TYPE_DEF)), false, pluginConfig); assertThat(true, is(test.equals(TYPE_DEF_PKG))); }
public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, YangToJavaNamingConflictUtil conflictResolver) { YangDataTypes type = yangType.getDataType(); if (isListAttr) { switch (type) { case INT8: case INT16: case INT32: case INT64: case UINT8: case UINT16: case UINT32: case STRING: case BOOLEAN: case EMPTY: return JAVA_LANG; case UINT64: return JAVA_MATH; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: throw new TranslatorException("given data type is not supported."); } } else { switch (type) { case UINT64: return JAVA_MATH; case STRING: return JAVA_LANG; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case EMPTY: return JAVA_LANG; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: return null; } } return null; }
AttributesJavaDataType { public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, YangToJavaNamingConflictUtil conflictResolver) { YangDataTypes type = yangType.getDataType(); if (isListAttr) { switch (type) { case INT8: case INT16: case INT32: case INT64: case UINT8: case UINT16: case UINT32: case STRING: case BOOLEAN: case EMPTY: return JAVA_LANG; case UINT64: return JAVA_MATH; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: throw new TranslatorException("given data type is not supported."); } } else { switch (type) { case UINT64: return JAVA_MATH; case STRING: return JAVA_LANG; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case EMPTY: return JAVA_LANG; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: return null; } } return null; } }
AttributesJavaDataType { public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, YangToJavaNamingConflictUtil conflictResolver) { YangDataTypes type = yangType.getDataType(); if (isListAttr) { switch (type) { case INT8: case INT16: case INT32: case INT64: case UINT8: case UINT16: case UINT32: case STRING: case BOOLEAN: case EMPTY: return JAVA_LANG; case UINT64: return JAVA_MATH; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: throw new TranslatorException("given data type is not supported."); } } else { switch (type) { case UINT64: return JAVA_MATH; case STRING: return JAVA_LANG; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case EMPTY: return JAVA_LANG; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: return null; } } return null; } private  AttributesJavaDataType(); }
AttributesJavaDataType { public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, YangToJavaNamingConflictUtil conflictResolver) { YangDataTypes type = yangType.getDataType(); if (isListAttr) { switch (type) { case INT8: case INT16: case INT32: case INT64: case UINT8: case UINT16: case UINT32: case STRING: case BOOLEAN: case EMPTY: return JAVA_LANG; case UINT64: return JAVA_MATH; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: throw new TranslatorException("given data type is not supported."); } } else { switch (type) { case UINT64: return JAVA_MATH; case STRING: return JAVA_LANG; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case EMPTY: return JAVA_LANG; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: return null; } } return null; } private  AttributesJavaDataType(); static String getJavaDataType(YangType<?> yangType); static String getJavaImportClass(YangType<?> yangType, boolean isListAttr,
                                            YangToJavaNamingConflictUtil pluginConfig); static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr,
                                              YangToJavaNamingConflictUtil conflictResolver); static void updateJavaFileInfo(YangNode yangNode,
                                          YangToJavaNamingConflictUtil conflictResolver); }
AttributesJavaDataType { public static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr, YangToJavaNamingConflictUtil conflictResolver) { YangDataTypes type = yangType.getDataType(); if (isListAttr) { switch (type) { case INT8: case INT16: case INT32: case INT64: case UINT8: case UINT16: case UINT32: case STRING: case BOOLEAN: case EMPTY: return JAVA_LANG; case UINT64: return JAVA_MATH; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: throw new TranslatorException("given data type is not supported."); } } else { switch (type) { case UINT64: return JAVA_MATH; case STRING: return JAVA_LANG; case ENUMERATION: return getEnumsPackage(yangType, conflictResolver); case DECIMAL64: case BITS: case BINARY: return YANG_TYPES_PKG; case LEAFREF: break; case IDENTITYREF: break; case EMPTY: return JAVA_LANG; case UNION: return getUnionPackage(yangType, conflictResolver); case INSTANCE_IDENTIFIER: break; case DERIVED: return getTypDefsPackage(yangType, conflictResolver); default: return null; } } return null; } private  AttributesJavaDataType(); static String getJavaDataType(YangType<?> yangType); static String getJavaImportClass(YangType<?> yangType, boolean isListAttr,
                                            YangToJavaNamingConflictUtil pluginConfig); static String getJavaImportPackage(YangType<?> yangType, boolean isListAttr,
                                              YangToJavaNamingConflictUtil conflictResolver); static void updateJavaFileInfo(YangNode yangNode,
                                          YangToJavaNamingConflictUtil conflictResolver);  }