public static @Nullable JsonSchemaType guessType(@NotNull JsonSchemaObject schemaObject) {
    // if we have an explicit type, here we are
    JsonSchemaType type = schemaObject.getType();
    if (type != null) return type;

    // process type variants before heuristic type detection
    final Set<JsonSchemaType> typeVariants = schemaObject.getTypeVariants();
    if (typeVariants != null) {
      final int size = typeVariants.size();
      if (size == 1) {
        return typeVariants.iterator().next();
      }
      else if (size >= 2) {
        return null;
      }
    }

    // heuristic type detection based on the set of applied constraints
    boolean hasObjectChecks = hasObjectChecks(schemaObject);
    boolean hasNumericChecks = hasNumericChecks(schemaObject);
    boolean hasStringChecks = hasStringChecks(schemaObject);
    boolean hasArrayChecks = hasArrayChecks(schemaObject);

    if (hasObjectChecks && !hasNumericChecks && !hasStringChecks && !hasArrayChecks) {
      return JsonSchemaType._object;
    }
    if (!hasObjectChecks && hasNumericChecks && !hasStringChecks && !hasArrayChecks) {
      return JsonSchemaType._number;
    }
    if (!hasObjectChecks && !hasNumericChecks && hasStringChecks && !hasArrayChecks) {
      return JsonSchemaType._string;
    }
    if (!hasObjectChecks && !hasNumericChecks && !hasStringChecks && hasArrayChecks) {
      return JsonSchemaType._array;
    }
    return null;
  }
public static @Nullable JsonSchemaType guessType(@NotNull JsonSchemaObject schemaObject)