List<JType> (String baseName, JsonNode parent, List<ResolvedClassType> objects, JDefinedClass superType, JPackage pkg) { List<JType> result = new ArrayList<>(); for (ResolvedClassType obj : objects) { Set<String> requiredFields = getRequiredFields(obj.node); String subTypeName = baseName + "-" + (obj.name != null ? obj.name : (requiredFields.isEmpty() ? "default" : StringUtils.join(requiredFields, "-"))); JDefinedClass subType = (JDefinedClass)ruleFactory.getObjectRule().apply(subTypeName, obj.node, parent, pkg, obj.schema); subType._extends(superType); result.add(subType); } return result; }