Class InMemoryLargeSourceSet

java.lang.Object
org.openrewrite.internal.InMemoryLargeSourceSet
All Implemented Interfaces:
LargeSourceSet

public class InMemoryLargeSourceSet extends Object implements LargeSourceSet
  • Constructor Details

    • InMemoryLargeSourceSet

      public InMemoryLargeSourceSet(List<SourceFile> ls)
  • Method Details

    • setRecipe

      public void setRecipe(List<Recipe> recipeStack)
      Description copied from interface: LargeSourceSet
      Maintain context about what recipe is performing an edit or generating code.
      Specified by:
      setRecipe in interface LargeSourceSet
      Parameters:
      recipeStack - A stack rooted at the currently operating recipe and extending up its containing recipes to top-level recipe that a developer is running directly.
    • edit

      Description copied from interface: LargeSourceSet
      Execute a transformation on all items.
      Specified by:
      edit in interface LargeSourceSet
      Parameters:
      map - A transformation on T
      Returns:
      A new source set if the map function results in any changes, otherwise this source set is returned.
    • generate

      public LargeSourceSet generate(@Nullable @Nullable Collection<? extends SourceFile> t)
      Description copied from interface: LargeSourceSet
      Concatenate new items. Where possible, implementations should not iterate the entire source set in order to accomplish this, since the ordering of SourceFile is not significant.
      Specified by:
      generate in interface LargeSourceSet
      Parameters:
      t - The new item to insert
      Returns:
      A new source set with the new item inserted.
    • getChangeset

      public Changeset getChangeset()
      Specified by:
      getChangeset in interface LargeSourceSet
      Returns:
      The set of changes (encompassing adds, edits, and deletions) to the initial state.