public TypeDef apply(Property item) { boolean isArray = TypeUtils.isArray(item.getTypeRef()); boolean isList = TypeUtils.isList(item.getTypeRef());
boolean isArray = TypeUtils.isArray(toAdd.getTypeRef()); boolean isSet = TypeUtils.isSet(toAdd.getTypeRef()); boolean isList = TypeUtils.isList(toAdd.getTypeRef());
final boolean isArray = TypeUtils.isArray(property.getTypeRef()); final boolean isSet = TypeUtils.isSet(property.getTypeRef()); final boolean isList = TypeUtils.isList(property.getTypeRef());
boolean isArray = TypeUtils.isArray(typeRef); boolean isSet = TypeUtils.isSet(typeRef); boolean isList = TypeUtils.isList(typeRef);
public Method apply(Property property) { String classPrefix = getClassPrefix(property); boolean isArray = TypeUtils.isArray(property.getTypeRef()); boolean isList = TypeUtils.isList(property.getTypeRef()); boolean isSet = TypeUtils.isSet(property.getTypeRef()); String prefix = isArray || isList ? "setTo" : "with"; String withMethodName = prefix + property.getNameCapitalized(); return new MethodBuilder() .withModifiers(TypeUtils.modifiersToInt(Modifier.PUBLIC)) .withReturnType(N_REF) .withName("and") .withNewBlock() .addNewStringStatementStatement("return (N) " + classPrefix + withMethodName + "(" + (isArray || isList ? "index, " : "") + "builder.build());") .endBlock() .build(); }
if (isList(property.getTypeRef()) || isArray(property.getTypeRef())) { String suffix = Singularize.FUNCTION.apply(property.getNameCapitalized()); methods.add(new MethodBuilder(base)