docs: @Override
      public JType apply(String nodeName, JsonNode node, JsonNode parent, JClassContainer container, Schema schema) {
  
          JDefinedClass _enum;
          try {
              _enum = createEnum(node, nodeName, container);
          } catch (ClassAlreadyExistsException e) {
              return e.getExistingClass();
          }
  
          schema.setJavaTypeIfEmpty(_enum);
  
          if (node.has("javaInterfaces")) {
              addInterfaces(_enum, node.get("javaInterfaces"));
          }
  
          // copy our node; remove the javaType as it will throw off the TypeRule for our case
          ObjectNode typeNode = (ObjectNode)node.deepCopy();
          typeNode.remove("javaType");
  
          // If type is specified on the enum, get a type rule for it.  Otherwise, we're a string.
          // (This is different from the default of Object, which is why we don't do this for every case.)
          JType backingType = node.has("type") ?
                  ruleFactory.getTypeRule().apply(nodeName, typeNode, parent, container, schema) :
                      container.owner().ref(String.class);
  
          JFieldVar valueField = addValueField(_enum, backingType);
  
          // override toString only if we have a sensible string to return
          if(isString(backingType)){
              addToString(_enum, valueField);
          }
  
          addValueMethod(_enum, valueField);
  
          addEnumConstants(node.path("enum"), _enum, node.path("javaEnumNames"), backingType);
          addFactoryMethod(_enum, backingType);
  
          return _enum;
      }