@Test public void testForJavaAttributeInfo() { String attributeWithoutTypePkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME, false); assertThat(true, is(attributeWithoutTypePkg.equals( PRIVATE + SPACE + STRING_DATA_TYPE + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE))); String attributeWithTypePkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME, false); assertThat(true, is(attributeWithTypePkg.equals(PRIVATE + SPACE + JAVA_LANG + PERIOD + STRING_DATA_TYPE + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE))); String attributeWithListPkg = getJavaAttributeDefination(JAVA_LANG, STRING_DATA_TYPE, YANG_NAME, true); assertThat(true, is(attributeWithListPkg.equals( PRIVATE + SPACE + LIST + DIAMOND_OPEN_BRACKET + JAVA_LANG + PERIOD + STRING_DATA_TYPE + DIAMOND_CLOSE_BRACKET + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE))); String attributeWithListWithoutPkg = getJavaAttributeDefination(null, STRING_DATA_TYPE, YANG_NAME, true); assertThat(true, is(attributeWithListWithoutPkg.equals( PRIVATE + SPACE + LIST + DIAMOND_OPEN_BRACKET + STRING_DATA_TYPE + DIAMOND_CLOSE_BRACKET + SPACE + YANG_NAME + SEMI_COLAN + NEW_LINE))); }
public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType, String javaAttributeName, boolean isList) { String attributeDefination = PRIVATE + SPACE; if (!isList) { if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } else { attributeDefination = attributeDefination + LIST + DIAMOND_OPEN_BRACKET; if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + DIAMOND_CLOSE_BRACKET + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } return attributeDefination; }
JavaCodeSnippetGen { public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType, String javaAttributeName, boolean isList) { String attributeDefination = PRIVATE + SPACE; if (!isList) { if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } else { attributeDefination = attributeDefination + LIST + DIAMOND_OPEN_BRACKET; if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + DIAMOND_CLOSE_BRACKET + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } return attributeDefination; } }
JavaCodeSnippetGen { public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType, String javaAttributeName, boolean isList) { String attributeDefination = PRIVATE + SPACE; if (!isList) { if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } else { attributeDefination = attributeDefination + LIST + DIAMOND_OPEN_BRACKET; if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + DIAMOND_CLOSE_BRACKET + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } return attributeDefination; } private  JavaCodeSnippetGen(); }
JavaCodeSnippetGen { public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType, String javaAttributeName, boolean isList) { String attributeDefination = PRIVATE + SPACE; if (!isList) { if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } else { attributeDefination = attributeDefination + LIST + DIAMOND_OPEN_BRACKET; if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + DIAMOND_CLOSE_BRACKET + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } return attributeDefination; } private  JavaCodeSnippetGen(); static String getFileHeaderComment(); static String getImportText(JavaQualifiedTypeInfo importInfo); static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType,
            String javaAttributeName, boolean isList); static String getListAttribute(String type); static String getAugmentedInfoAttribute(); static String getJavaClassDefClose(); static String generateEnumAttributeString(String name, int value, YangPluginConfig pluginConfig); }
JavaCodeSnippetGen { public static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType, String javaAttributeName, boolean isList) { String attributeDefination = PRIVATE + SPACE; if (!isList) { if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } else { attributeDefination = attributeDefination + LIST + DIAMOND_OPEN_BRACKET; if (javaAttributeTypePkg != null) { attributeDefination = attributeDefination + javaAttributeTypePkg + PERIOD; } attributeDefination = attributeDefination + javaAttributeType + DIAMOND_CLOSE_BRACKET + SPACE + javaAttributeName + SEMI_COLAN + NEW_LINE; } return attributeDefination; } private  JavaCodeSnippetGen(); static String getFileHeaderComment(); static String getImportText(JavaQualifiedTypeInfo importInfo); static String getJavaAttributeDefination(String javaAttributeTypePkg, String javaAttributeType,
            String javaAttributeName, boolean isList); static String getListAttribute(String type); static String getAugmentedInfoAttribute(); static String getJavaClassDefClose(); static String generateEnumAttributeString(String name, int value, YangPluginConfig pluginConfig);  }