private Map<String, JType> generateEnumBasedSubTypes(String baseName,
                                                       JsonNode parent,
                                                       List<ResolvedClassType> objects,
                                                       String propertyName,
                                                       JDefinedClass superType,
                                                       JPackage pkg) {
    Map<String, JType> result = new TreeMap<>();
    for (ResolvedClassType obj : objects) {
      ObjectNode node = (ObjectNode)obj.node;
      JsonNode determinant = ((ObjectNode)node.path("properties")).remove(propertyName);
      String key = getConstString(determinant);
      node.set("title", JsonNodeFactory.instance.textNode(propertyName + " = " + key));
      String name = obj.name != null ? obj.name : baseName + "." + key;
      JDefinedClass subType = (JDefinedClass)ruleFactory.getObjectRule().apply(name, node, parent, pkg, obj.schema);
      subType._extends(superType);
      result.put(key, subType);
    }
    return result;
  }
private Map<String, JType> generateEnumBasedSubTypes(String baseName,
                                                       JsonNode parent,
                                                       List<ResolvedClassType> objects,
                                                       String propertyName,
                                                       JDefinedClass superType,
                                                       JPackage pkg)