AssertTree (Java SE 26 & JDK 26)
Description: declaration: module: jdk.compiler, package: com.sun.source.tree, interface: AssertTree
Keywords: com.sun.source.tree.AssertTree interface

# Interface AssertTree

All Superinterfaces:
  `StatementTree, Tree`

public interface AssertTree extends StatementTree
A tree node for an `assert` statement. For example:

      assert condition ;

      assert condition : detail ;

See Java Language Specification:
  14.10 The assert Statement
Since:
  1.6

- ## Nested Class Summary

  ### Nested classes/interfaces declared in interface Tree

  `Tree.Kind`
  Modifier and Type
  Interface
  Description
  `static enum`
  `Tree.Kind`
  Enumerates all kinds of trees.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `ExpressionTree`
  `getCondition()`
  Returns the condition being asserted.
  `ExpressionTree`
  `getDetail()`
  Returns the detail expression.

  ### Methods declared in interface Tree

  `accept, getKind`
  Modifier and Type
  Method
  Description
  `<R,D> R`
  `accept(TreeVisitor<R,D> visitor, D data)`
  Accept method used to implement the visitor pattern.
  `Tree.Kind`
  `getKind()`
  Returns the kind of this tree.

- ## Method Details

  - ### getCondition

    ExpressionTree getCondition()
    Returns the condition being asserted.
    Returns:
      the condition

  - ### getDetail

    ExpressionTree getDetail()
    Returns the detail expression.
    Returns:
      the detail expression