Naming naming() { return pojoInfo().naming(); }
public static TestableContribution of(PojoInfo pojoInfo) { Naming naming = pojoInfo.naming(); TypeName superClassTypeName = naming.superClassTypeName(); ParameterizedTypeName testerTypeName = ParameterizedTypeName.get(TESTER, naming.superClass()); return superClassTypeName instanceof ParameterizedTypeName ? new Generic(pojoInfo, testerTypeName) : new TestableContribution(pojoInfo, testerTypeName); }
public static PojoClass of(PojoInfo pojoInfo, TypeInfo typeInfo) { Naming naming = pojoInfo.naming(); TypeSpec.Builder type = TypeSpec .classBuilder(naming.pojoSimpleName()) .addModifiers(Modifier.FINAL) .superclass(naming.superClassTypeName()); naming.typeVariableNameListTo(type); List<InvalidateMethod> invalidateMethodList = InvalidateMethod.of(typeInfo); return new PojoClass(pojoInfo, type, invalidateMethodList); }
public static PojoClass of(PojoInfo pojoInfo, TypeInfo typeInfo) { Naming naming = pojoInfo.naming(); TypeSpec.Builder type = TypeSpec .classBuilder(naming.pojoSimpleName()) .addModifiers(Modifier.FINAL) .superclass(naming.superClassTypeName()); naming.typeVariableNameListTo(type); List<InvalidateMethod> invalidateMethodList = InvalidateMethod.of(typeInfo); return new PojoClass(pojoInfo, type, invalidateMethodList); }
private Artifact execute() { executePojoPluginList(); executePojoPropertyPluginList(); executeMethodPluginList(); executeInvalidateMethodPluginList(); generatedBy.accept(type); invalidateMethodList.forEach(m -> m.accept(type)); return pojoInfo.naming().toArtifact(type); }
private Artifact execute() { executePojoPluginList(); executePojoPropertyPluginList(); executeMethodPluginList(); executeInvalidateMethodPluginList(); generatedBy.accept(type); invalidateMethodList.forEach(m -> m.accept(type)); return pojoInfo.naming().toArtifact(type); }
private CodeBlock fieldInitializer() { Naming naming = pojoInfo.naming(); CodeBlock.Builder init = CodeBlock.builder() .add("$T.of($T.class)\n", TESTER, naming.superClass()); pojoInfo.propertyStream() .filter(property -> !property.hasAnnotation(NotTestable.class)) .forEach(property -> init.add(" .add($S, o -> o.$L())\n", property.name(), property.accessorName())); return init .add(" .build()") .build(); }