code: public static <E extends Enum<E>> E asEnum(ModelNode value, Class<E> targetClass) {
          return asEnum(value, targetClass, null);
      }
docs: Returns the value of the node as an Enum value, or null if the node is undefined.
  @param value a model node
  @return the value of the node as an Enum, or null if the node is undefined.