Class Repeat

java.lang.Object
org.openrewrite.Repeat

public class Repeat extends Object
  • Constructor Details

    • Repeat

      public Repeat()
  • Method Details

    • repeatUntilStable

      public static TreeVisitor<?,ExecutionContext> repeatUntilStable(TreeVisitor<?,ExecutionContext> v)
      Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or a maximum of 3 cycles is reached. Convenient when a visitor is designed to recursively apply itself to a tree to achieve its desired result. Stops early if the visitor ceases to make changes to the tree before the maximum number of cycles is reached.
    • repeatUntilStable

      public static TreeVisitor<?,ExecutionContext> repeatUntilStable(TreeVisitor<?,ExecutionContext> v, int maxCycles)
      Returns a new visitor which runs the supplied visitor in a loop until no more changes are made, or the maximum number of cycles is reached. Convenient when a visitor is designed to recursively apply itself to a tree to achieve its desired result. Stops early if the visitor ceases to make changes to the tree before the maximum number of cycles is reached.