code: public void setWarningLevel(CompilerOptions options, String name, CheckLevel level) {
      DiagnosticGroup group = forName(name);
      Preconditions.checkNotNull(group, "No warning class for name: %s", name);
      options.setWarningLevel(group, level);
    }
docs: Adds warning levels by name.