Class ProblemGroup

java.lang.Object
org.gradle.api.problems.ProblemGroup
Direct Known Subclasses:
GradleProblemGroup, GradleSecondLevelProblemGroup, RootProblemGroup, SecondLevelProblemGroup, ThirdLevelProblemGroup, UndefinedProblemGroup

@Incubating @Immutable public abstract class ProblemGroup extends Object
Represents a group of problems.

Groups are organized in hierarchy where the parent group should represent the more broad problem group.

Two problem groups are considered equal if their getName() and their parents are equal.

Gradle provides a predefined hierarchy of groups, see ProblemGroups.

Since:
8.8
See Also:
  • Constructor Details

    • ProblemGroup

      @Deprecated protected ProblemGroup()
      Deprecated.
      Subclassing ProblemGroup outside of Gradle is deprecated and will not be supported in Gradle 10. Use the groups from Problems.getGroups() instead.
      Constructor.
      Since:
      8.13
  • Method Details

    • getName

      public abstract String getName()
      The name of the problem group.
      Since:
      8.8
    • getDisplayName

      @Deprecated public abstract String getDisplayName()
      Deprecated.
      Use getName() instead. The display name of a group from Problems.getGroups() is its name. This method will be removed in Gradle 10.
      Returns a human-readable label describing the group.
      Since:
      8.8
    • getParent

      @Deprecated public abstract @Nullable ProblemGroup getParent()
      Deprecated.
      The groups from Problems.getGroups() have a fixed place in the predefined hierarchy, so there is no need to walk it. This method will be removed in Gradle 10 without replacement.
      Returns the parent group or null for root groups.
      Since:
      8.8
    • create

      @Deprecated public static ProblemGroup create(String name, String displayName)
      Deprecated.
      Use the predefined groups from Problems.getGroups() instead. For problems that fit no predefined root group, create a sub-group with getGroups().getOthers().group(name), see RootProblemGroup.group(String). This method will be removed in Gradle 11.
      Creates a new root problem group i.e. a group with no parent.
      Parameters:
      name - the name of the group. Cannot be blank (i.e., null, empty string, or only whitespaces).
      displayName - the user-friendly display name of the group. Cannot be blank (i.e., null, empty string, or only whitespaces).
      Returns:
      the new group
      Since:
      8.13
    • create

      @Deprecated public static ProblemGroup create(String name, String displayName, @Nullable ProblemGroup parent)
      Deprecated.
      Use the predefined groups from Problems.getGroups() instead, and create sub-groups with RootProblemGroup.group(String) or SecondLevelProblemGroup.group(String). This method will be removed in Gradle 11.
      Creates a new problem group.
      Parameters:
      name - the name of the group. Cannot be blank (i.e., null, empty string, or only whitespaces).
      displayName - the user-friendly display name of the group. Cannot be blank (i.e., null, empty string, or only whitespaces).
      parent - the parent group. May be null for root groups.
      Returns:
      the new group
      Since:
      8.13