Class Categories


  • public final class Categories
    extends Object
    Provides convenience methods to detect categories.
    Author:
    Ullrich Hafner
    • Method Detail

      • guessCategory

        public static String guessCategory​(@CheckForNull
                                           String message)
        Classifies the warning message: tries to guess a category from the warning message.
        Parameters:
        message - the message to check
        Returns:
        warning category, empty string if unknown
      • guessCategoryIfEmpty

        public static String guessCategoryIfEmpty​(@CheckForNull
                                                  String category,
                                                  @CheckForNull
                                                  String message)
        Returns a category for the current warning. If the provided category is not empty, then a capitalized string is returned. Otherwise the category is obtained from the specified message text.
        Parameters:
        category - the warning category (might be empty)
        message - the warning message
        Returns:
        the actual category