@Test public void testGetClassName() { String name = "com.flipkart.lyrics.Test"; ClassName className = Helper.getClassName(name); assertEquals("com.flipkart.lyrics", className.packageName()); assertEquals("Test", className.simpleName()); }
public static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames) { int lastIndex = name.lastIndexOf("."); if (lastIndex < 0) { TypeName typeName = typeVariableNames.get(name); return typeName != null ? typeName : ClassName.get("", name); } return ClassName.get(name.substring(0, lastIndex), name.substring(lastIndex + 1)); }
Helper { public static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames) { int lastIndex = name.lastIndexOf("."); if (lastIndex < 0) { TypeName typeName = typeVariableNames.get(name); return typeName != null ? typeName : ClassName.get("", name); } return ClassName.get(name.substring(0, lastIndex), name.substring(lastIndex + 1)); } }
Helper { public static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames) { int lastIndex = name.lastIndexOf("."); if (lastIndex < 0) { TypeName typeName = typeVariableNames.get(name); return typeName != null ? typeName : ClassName.get("", name); } return ClassName.get(name.substring(0, lastIndex), name.substring(lastIndex + 1)); }  }
Helper { public static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames) { int lastIndex = name.lastIndexOf("."); if (lastIndex < 0) { TypeName typeName = typeVariableNames.get(name); return typeName != null ? typeName : ClassName.get("", name); } return ClassName.get(name.substring(0, lastIndex), name.substring(lastIndex + 1)); }  static boolean isNullOrEmpty(String string); static boolean isNullOrEmpty(Map map); static boolean isNullOrEmpty(Collection collection); static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames); static ClassName getClassName(String name); static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive); static TypeName getResolvedTypeName(VariableModel variableModel, final Map<String, TypeVariableName> typeVariableNames,
                                               Chords chords); static Map<String, TypeVariableName> getTypeVariables(List<GenericVariableModel> genericVariables, Chords chords); static Modifier[] resolveModifiers(Tune tune, FieldModel fieldModel); static TypeCreator getCreator(Type type, CreatorSet creatorSet); static FieldTypeHandler getFieldTypeHandler(FieldType type, FieldTypeHandlerSet handlerSet); static ParameterTypeHandler getParameterTypeHandler(FieldType type, ParameterTypeHandlerSet handlerSet); static TypeName processType(FieldModel fieldModel, Map<String, TypeVariableName> typeVariableNames, Chords chords); static List<String> getRequiredFields(Map<String, FieldModel> fields, boolean excludeInitializedFields); }
Helper { public static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames) { int lastIndex = name.lastIndexOf("."); if (lastIndex < 0) { TypeName typeName = typeVariableNames.get(name); return typeName != null ? typeName : ClassName.get("", name); } return ClassName.get(name.substring(0, lastIndex), name.substring(lastIndex + 1)); }  static boolean isNullOrEmpty(String string); static boolean isNullOrEmpty(Map map); static boolean isNullOrEmpty(Collection collection); static TypeName getClassName(String name, Map<String, TypeVariableName> typeVariableNames); static ClassName getClassName(String name); static String getGetterSetterName(String name, boolean isSetter, boolean isBoolean, boolean isPrimitive); static TypeName getResolvedTypeName(VariableModel variableModel, final Map<String, TypeVariableName> typeVariableNames,
                                               Chords chords); static Map<String, TypeVariableName> getTypeVariables(List<GenericVariableModel> genericVariables, Chords chords); static Modifier[] resolveModifiers(Tune tune, FieldModel fieldModel); static TypeCreator getCreator(Type type, CreatorSet creatorSet); static FieldTypeHandler getFieldTypeHandler(FieldType type, FieldTypeHandlerSet handlerSet); static ParameterTypeHandler getParameterTypeHandler(FieldType type, ParameterTypeHandlerSet handlerSet); static TypeName processType(FieldModel fieldModel, Map<String, TypeVariableName> typeVariableNames, Chords chords); static List<String> getRequiredFields(Map<String, FieldModel> fields, boolean excludeInitializedFields); static final TriConsumer<ValidationAnnotatorStyle, FieldModel, ParameterSpec.Builder> requiredParameterConstructorParadigm; }