Class ConstantFold
java.lang.Object
org.openrewrite.analysis.constantfold.ConstantFold
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic fj.data.Option<org.openrewrite.analysis.trait.expr.Expr>findConstantExpr(DataFlowNode node) Find the constant expression that is being assigned to a variable, if any.static fj.data.Option<org.openrewrite.analysis.trait.expr.Expr>findConstantExpr(org.openrewrite.Cursor cursor) Find the constant expression that is being assigned to a variable, if any.static fj.data.Option<org.openrewrite.java.tree.J>findConstantJ(org.openrewrite.Cursor cursor) Find the constant value that is being assigned to a variable, if any.static fj.data.Option<org.openrewrite.analysis.trait.expr.Literal>static fj.data.Option<org.openrewrite.analysis.trait.expr.Literal>findConstantLiteral(org.openrewrite.Cursor cursor) static <T> fj.data.Option<T>findConstantLiteralValue(DataFlowNode node, Class<T> type) static <T> fj.data.Option<T>findConstantLiteralValue(org.openrewrite.Cursor cursor, Class<T> type)
-
Constructor Details
-
ConstantFold
public ConstantFold()
-
-
Method Details
-
findConstantJ
public static fj.data.Option<org.openrewrite.java.tree.J> findConstantJ(org.openrewrite.Cursor cursor) Find the constant value that is being assigned to a variable, if any. Otherwise, return theJitself. -
findConstantExpr
public static fj.data.Option<org.openrewrite.analysis.trait.expr.Expr> findConstantExpr(org.openrewrite.Cursor cursor) Find the constant expression that is being assigned to a variable, if any. Otherwise, return the expression itself. -
findConstantExpr
public static fj.data.Option<org.openrewrite.analysis.trait.expr.Expr> findConstantExpr(DataFlowNode node) Find the constant expression that is being assigned to a variable, if any. Otherwise, return the expression itself. -
findConstantLiteral
public static fj.data.Option<org.openrewrite.analysis.trait.expr.Literal> findConstantLiteral(org.openrewrite.Cursor cursor) -
findConstantLiteral
public static fj.data.Option<org.openrewrite.analysis.trait.expr.Literal> findConstantLiteral(DataFlowNode node) -
findConstantLiteralValue
public static <T> fj.data.Option<T> findConstantLiteralValue(org.openrewrite.Cursor cursor, Class<T> type) -
findConstantLiteralValue
-