code: public static DeprecationWarnings getDeprecationWarnings(
              int deprecationLevel, boolean failOnWarn) {
  
          if (deprecationLevel < 0) {
              return DeprecationWarnings.OFF;
          } else {
              return failOnWarn ? DeprecationWarnings.FATAL
                      : DeprecationWarnings.ON;
          }
      }
docs: Utility method to turn old options into new deprecation flag.