@Test public void getExplicitTypeTest() throws Exception { assertEquals(annotationType.getName(), GeneratorUtil.getExplicitType( generatedType, annotationType, createImports(generatedType))); assertTrue(GeneratorUtil.getExplicitType(generatedType, parameterizedType, createImports(generatedType)).contains(parameterizedType.getName())); }
static String getExplicitType(final GeneratedType parentGenType, final Type type, final Map<String, JavaTypeName> imports) { checkArgument(type != null, "Type parameter MUST be specified and cannot be NULL!"); checkArgument(imports != null, "Imports Map cannot be NULL!"); final JavaTypeName importedType = imports.get(type.getName()); final StringBuilder builder = new StringBuilder(); if (type.getIdentifier().equals(importedType)) { builder.append(type.getName()); addActualTypeParameters(builder, type, parentGenType, imports); if (builder.toString().equals("Void")) { return "void"; } } else { if (type.equals(Types.voidType())) { return "void"; } builder.append(type.getFullyQualifiedName()); addActualTypeParameters(builder, type, parentGenType, imports); } return builder.toString(); }
GeneratorUtil { static String getExplicitType(final GeneratedType parentGenType, final Type type, final Map<String, JavaTypeName> imports) { checkArgument(type != null, "Type parameter MUST be specified and cannot be NULL!"); checkArgument(imports != null, "Imports Map cannot be NULL!"); final JavaTypeName importedType = imports.get(type.getName()); final StringBuilder builder = new StringBuilder(); if (type.getIdentifier().equals(importedType)) { builder.append(type.getName()); addActualTypeParameters(builder, type, parentGenType, imports); if (builder.toString().equals("Void")) { return "void"; } } else { if (type.equals(Types.voidType())) { return "void"; } builder.append(type.getFullyQualifiedName()); addActualTypeParameters(builder, type, parentGenType, imports); } return builder.toString(); } }
GeneratorUtil { static String getExplicitType(final GeneratedType parentGenType, final Type type, final Map<String, JavaTypeName> imports) { checkArgument(type != null, "Type parameter MUST be specified and cannot be NULL!"); checkArgument(imports != null, "Imports Map cannot be NULL!"); final JavaTypeName importedType = imports.get(type.getName()); final StringBuilder builder = new StringBuilder(); if (type.getIdentifier().equals(importedType)) { builder.append(type.getName()); addActualTypeParameters(builder, type, parentGenType, imports); if (builder.toString().equals("Void")) { return "void"; } } else { if (type.equals(Types.voidType())) { return "void"; } builder.append(type.getFullyQualifiedName()); addActualTypeParameters(builder, type, parentGenType, imports); } return builder.toString(); } private  GeneratorUtil(); }
GeneratorUtil { static String getExplicitType(final GeneratedType parentGenType, final Type type, final Map<String, JavaTypeName> imports) { checkArgument(type != null, "Type parameter MUST be specified and cannot be NULL!"); checkArgument(imports != null, "Imports Map cannot be NULL!"); final JavaTypeName importedType = imports.get(type.getName()); final StringBuilder builder = new StringBuilder(); if (type.getIdentifier().equals(importedType)) { builder.append(type.getName()); addActualTypeParameters(builder, type, parentGenType, imports); if (builder.toString().equals("Void")) { return "void"; } } else { if (type.equals(Types.voidType())) { return "void"; } builder.append(type.getFullyQualifiedName()); addActualTypeParameters(builder, type, parentGenType, imports); } return builder.toString(); } private  GeneratorUtil();  }
GeneratorUtil { static String getExplicitType(final GeneratedType parentGenType, final Type type, final Map<String, JavaTypeName> imports) { checkArgument(type != null, "Type parameter MUST be specified and cannot be NULL!"); checkArgument(imports != null, "Imports Map cannot be NULL!"); final JavaTypeName importedType = imports.get(type.getName()); final StringBuilder builder = new StringBuilder(); if (type.getIdentifier().equals(importedType)) { builder.append(type.getName()); addActualTypeParameters(builder, type, parentGenType, imports); if (builder.toString().equals("Void")) { return "void"; } } else { if (type.equals(Types.voidType())) { return "void"; } builder.append(type.getFullyQualifiedName()); addActualTypeParameters(builder, type, parentGenType, imports); } return builder.toString(); } private  GeneratorUtil();   }