// convert JavaAttribute parameters into fields
List<Field> fields = new ArrayList<>();
for (JavaAttribute ja : rpc.getParameters()) {
- Field field = new Field(Collections.<String> emptyList(),
+ Field field = new Field(Collections.emptyList(),
ja.getType().getFullyQualifiedName(),
ja.getLowerCaseCammelCase(), ja.getNullableDefaultWrappedForCode());
fields.add(field);
" final %s that = (%s) o;\n", name, name));
for (AttributeIfc s : attrs.values()) {
equalsBodyBuilder.append(String.format(
- " if(java.util.Objects.equals(%1$s, that.%1$s) == false) {\n" +
+ " if (!java.util.Objects.equals(%1$s, that.%1$s)) {\n" +
" return false;\n" +
" }\n\n", s.getLowerCaseCammelCase()));
}
String setterBody = "this." + varName + " = " + varName + ";";
if (isListOfDependencies) {
- String nullCheck = String.format("if (%s == null) throw new IllegalArgumentException(\"Null not supported\");%n",
- varName);
+ String nullCheck = String.format("if (%s == null) {\n%s = new java.util.ArrayList<>(); \n}%n",
+ varName, varName);
setterBody = nullCheck + setterBody;
}
MethodDefinition setter = new MethodDefinition("void",