Class SearchResult

java.lang.Object
org.openrewrite.marker.SearchResult
All Implemented Interfaces:
Marker

public final class SearchResult extends Object implements Marker
  • Constructor Details

    • SearchResult

      public SearchResult()
  • Method Details

    • found

      public static <T extends Tree> T found(@Nullable T t)
    • found

      public static <T extends Tree> T found(@Nullable T t, @Nullable @Nullable String description)
    • mergingFound

      @Incubating(since="8.0.0") public static <T extends Tree> T mergingFound(@Nullable T t, String description)
      Merge the description of two search results into a single search result with a unified description.

      If the there already exists a search result with the same description, the existing search result is returned.

    • mergingFound

      @Incubating(since="8.0.0") public static <T extends Tree> T mergingFound(@Nullable T t, String description, String delimiter)
      Merge the description of two search results into a single search result with a unified description.

      If the there already exists a search result with the same description, the existing search result is returned.

      Parameters:
      delimiter - The delimiter to use when merging descriptions.
    • print

      public String print(Cursor cursor, UnaryOperator<String> commentWrapper, boolean verbose)
      Specified by:
      print in interface Marker
      Parameters:
      cursor - The cursor at the point where the marker is being visited.
      commentWrapper - A function that wraps arbitrary text in a multi-line comment that is language-specific.
      Returns:
      The printed representation of the marker.