use of com.airbnb.epoxy.ClassToGenerateInfo.MethodInfo in project epoxy by airbnb.
the class EpoxyProcessor method generateMethodsReturningClassType.
private Iterable<MethodSpec> generateMethodsReturningClassType(ClassToGenerateInfo info) {
List<MethodSpec> methods = new ArrayList<>(info.getMethodsReturningClassType().size());
for (MethodInfo methodInfo : info.getMethodsReturningClassType()) {
Builder builder = MethodSpec.methodBuilder(methodInfo.name).addModifiers(methodInfo.modifiers).addParameters(methodInfo.params).addAnnotation(Override.class).varargs(methodInfo.varargs).returns(info.getParameterizedGeneratedName());
StringBuilder statementBuilder = new StringBuilder(String.format("super.%s(", methodInfo.name));
generateParams(statementBuilder, methodInfo.params);
methods.add(builder.addStatement(statementBuilder.toString()).addStatement("return this").build());
}
return methods;
}
Aggregations