@Test public void getGetterForClassTest() { JavaAttributeInfo testAttr = getTestAttribute(); String method = getGetterForClass(testAttr, GENERATE_SERVICE_AND_MANAGER); assertThat(true, is(method.contains(PUBLIC + SPACE + STRING_DATA_TYPE + SPACE + GET_METHOD_PREFIX))); }
public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles) { String attrQuaifiedType = getReturnType(attr); String attributeName = attr.getAttributeName(); if (!attr.isListAttr()) { return getGetter(attrQuaifiedType, attributeName, generatedJavaFiles); } String listAttr = getListString() + attrQuaifiedType + DIAMOND_CLOSE_BRACKET; return getGetter(listAttr, attributeName, generatedJavaFiles); }
MethodsGenerator { public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles) { String attrQuaifiedType = getReturnType(attr); String attributeName = attr.getAttributeName(); if (!attr.isListAttr()) { return getGetter(attrQuaifiedType, attributeName, generatedJavaFiles); } String listAttr = getListString() + attrQuaifiedType + DIAMOND_CLOSE_BRACKET; return getGetter(listAttr, attributeName, generatedJavaFiles); } }
MethodsGenerator { public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles) { String attrQuaifiedType = getReturnType(attr); String attributeName = attr.getAttributeName(); if (!attr.isListAttr()) { return getGetter(attrQuaifiedType, attributeName, generatedJavaFiles); } String listAttr = getListString() + attrQuaifiedType + DIAMOND_CLOSE_BRACKET; return getGetter(listAttr, attributeName, generatedJavaFiles); } private  MethodsGenerator(); }
MethodsGenerator { public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles) { String attrQuaifiedType = getReturnType(attr); String attributeName = attr.getAttributeName(); if (!attr.isListAttr()) { return getGetter(attrQuaifiedType, attributeName, generatedJavaFiles); } String listAttr = getListString() + attrQuaifiedType + DIAMOND_CLOSE_BRACKET; return getGetter(listAttr, attributeName, generatedJavaFiles); } private  MethodsGenerator(); static String parseBuilderInterfaceBuildMethodString(String name, YangPluginConfig pluginConfig); static String getGetterString(JavaAttributeInfo attr, int generatedJavaFiles,
                                         YangPluginConfig pluginConfig); static String getSetterString(JavaAttributeInfo attr, String className, int generatedJavaFiles,
                                         YangPluginConfig pluginConfig); static String getConstructorString(String name, YangPluginConfig pluginConfig); static String getDefaultConstructorString(String name, String modifierType,
                                                     YangPluginConfig pluginConfig); static String getCheckNotNull(String name); static String getBuildString(String name); static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles); static String getGetter(String type, String name, int generatedJavaFiles); static String getSetterForClass(JavaAttributeInfo attr, String className, int generatedJavaFiles); static String getSetterForTypeDefClass(JavaAttributeInfo attr); static String getOverRideString(); static String getGetterForInterface(String yangName, String returnType, boolean isList,
                                               int generatedJavaFiles); static String getSetterForInterface(String attrName, String attrType, String className,
                                               boolean isList, int generatedJavaFiles); static String getBuildForInterface(String yangName); static String getConstructorStart(String yangName, YangPluginConfig pluginConfig); static String getConstructor(String yangName, JavaAttributeInfo attr, int generatedJavaFiles,
                                        YangPluginConfig pluginConfig); static String getRpcServiceMethod(String rpcName, String inputName, String outputName,
                                             YangPluginConfig pluginConfig); static String getRpcManagerMethod(String rpcName, String inputName, String outputName,
                                             YangPluginConfig pluginConfig); static String getBuild(String yangName); static String getToStringMethodOpen(); static String getOmitNullValueString(); static String getToStringMethodClose(); static String getToStringMethod(JavaAttributeInfo attr); static String getFromStringMethodSignature(String className, YangPluginConfig pluginConfig); static String getFromStringMethodClose(); static String getFromStringMethod(JavaAttributeInfo attr,
                                             JavaAttributeInfo fromStringAttributeInfo); static String getTrySubString(); static String getReturnOfSubString(); static String getCatchSubString(); static String getHashCodeMethodOpen(); static String getHashCodeMethodClose(String hashcodeString); static String getHashCodeMethod(JavaAttributeInfo attr); static String getEqualsMethodOpen(String className); static String getEqualsMethodClose(String equalMethodString); static String getEqualsMethod(JavaAttributeInfo attr); static String getOfMethod(String name, JavaAttributeInfo attr); static String getOfMethodStringAndJavaDoc(JavaAttributeInfo attr, String generatedJavaClassName,
                                                     YangPluginConfig pluginConfig); static String getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr,
                                                            String generatedJavaClassName,
                                                            YangPluginConfig pluginConfig); static String getAddAugmentInfoMethodImpl(); static String getAugmentInfoListImpl(); static String getRemoveAugmentationImpl(); static String getEnumsConstrcutor(String className); static String getEnumsOfMethod(String className, JavaAttributeInfo attr,
                                          Map<String, Integer> enumMap, List<String> enumList,
                                          YangPluginConfig pluginConfig); static String addActivateMethod(); static String addDeActivateMethod(); static String getParseFromStringMethod(String targetDataType, YangType<?> yangType); }
MethodsGenerator { public static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles) { String attrQuaifiedType = getReturnType(attr); String attributeName = attr.getAttributeName(); if (!attr.isListAttr()) { return getGetter(attrQuaifiedType, attributeName, generatedJavaFiles); } String listAttr = getListString() + attrQuaifiedType + DIAMOND_CLOSE_BRACKET; return getGetter(listAttr, attributeName, generatedJavaFiles); } private  MethodsGenerator(); static String parseBuilderInterfaceBuildMethodString(String name, YangPluginConfig pluginConfig); static String getGetterString(JavaAttributeInfo attr, int generatedJavaFiles,
                                         YangPluginConfig pluginConfig); static String getSetterString(JavaAttributeInfo attr, String className, int generatedJavaFiles,
                                         YangPluginConfig pluginConfig); static String getConstructorString(String name, YangPluginConfig pluginConfig); static String getDefaultConstructorString(String name, String modifierType,
                                                     YangPluginConfig pluginConfig); static String getCheckNotNull(String name); static String getBuildString(String name); static String getGetterForClass(JavaAttributeInfo attr, int generatedJavaFiles); static String getGetter(String type, String name, int generatedJavaFiles); static String getSetterForClass(JavaAttributeInfo attr, String className, int generatedJavaFiles); static String getSetterForTypeDefClass(JavaAttributeInfo attr); static String getOverRideString(); static String getGetterForInterface(String yangName, String returnType, boolean isList,
                                               int generatedJavaFiles); static String getSetterForInterface(String attrName, String attrType, String className,
                                               boolean isList, int generatedJavaFiles); static String getBuildForInterface(String yangName); static String getConstructorStart(String yangName, YangPluginConfig pluginConfig); static String getConstructor(String yangName, JavaAttributeInfo attr, int generatedJavaFiles,
                                        YangPluginConfig pluginConfig); static String getRpcServiceMethod(String rpcName, String inputName, String outputName,
                                             YangPluginConfig pluginConfig); static String getRpcManagerMethod(String rpcName, String inputName, String outputName,
                                             YangPluginConfig pluginConfig); static String getBuild(String yangName); static String getToStringMethodOpen(); static String getOmitNullValueString(); static String getToStringMethodClose(); static String getToStringMethod(JavaAttributeInfo attr); static String getFromStringMethodSignature(String className, YangPluginConfig pluginConfig); static String getFromStringMethodClose(); static String getFromStringMethod(JavaAttributeInfo attr,
                                             JavaAttributeInfo fromStringAttributeInfo); static String getTrySubString(); static String getReturnOfSubString(); static String getCatchSubString(); static String getHashCodeMethodOpen(); static String getHashCodeMethodClose(String hashcodeString); static String getHashCodeMethod(JavaAttributeInfo attr); static String getEqualsMethodOpen(String className); static String getEqualsMethodClose(String equalMethodString); static String getEqualsMethod(JavaAttributeInfo attr); static String getOfMethod(String name, JavaAttributeInfo attr); static String getOfMethodStringAndJavaDoc(JavaAttributeInfo attr, String generatedJavaClassName,
                                                     YangPluginConfig pluginConfig); static String getTypeConstructorStringAndJavaDoc(JavaAttributeInfo attr,
                                                            String generatedJavaClassName,
                                                            YangPluginConfig pluginConfig); static String getAddAugmentInfoMethodImpl(); static String getAugmentInfoListImpl(); static String getRemoveAugmentationImpl(); static String getEnumsConstrcutor(String className); static String getEnumsOfMethod(String className, JavaAttributeInfo attr,
                                          Map<String, Integer> enumMap, List<String> enumList,
                                          YangPluginConfig pluginConfig); static String addActivateMethod(); static String addDeActivateMethod(); static String getParseFromStringMethod(String targetDataType, YangType<?> yangType);  }