Skip to content

AssertStmt Statement

AssertStmt Entity

AssertStmt is a statement that asserts a condition.

Example

class MyClass {
...
public void myMethod()
{
assert myLocalVariable == 1; // AssertStmt
}
....
}

Attributes

EntityDescription
GetAPrimaryQlClass() stringReturns the primary QL class name for the assert statement
GetHalsteadID() intReturns the Halstead ID metric for complexity measurement of the assert statement
GetPP() stringReturns the pretty-printed representation of the assert statement
ToString() stringReturns a string representation of the assert statement
GetMessage() *ExprReturns the message expression associated with the assert statement if present
GetExpr() *ExprReturns the condition expression being asserted in the statement