public boolean isValid() {
    final String dirName = getPath();
    final String moduleName = getModuleName();

    return switch (getScopeType()) {
      case MODULE -> moduleName != null && !moduleName.isEmpty();
      case DIRECTORY -> dirName != null && !dirName.isEmpty() && findFile(dirName) != null;
      case CUSTOM -> myCustomScope != null;
      case PROJECT -> true;
    };
  }
public boolean isValid()