Package org.openrewrite.internal
Class InMemoryLargeSourceSet
java.lang.Object
org.openrewrite.internal.InMemoryLargeSourceSet
- All Implemented Interfaces:
LargeSourceSet
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInMemoryLargeSourceSet(@Nullable InMemoryLargeSourceSet initialState, @Nullable Map<SourceFile, List<Recipe>> deletions, List<SourceFile> ls) -
Method Summary
Modifier and TypeMethodDescriptionedit(UnaryOperator<SourceFile> map) Execute a transformation on all items.generate(@Nullable Collection<? extends SourceFile> t) Concatenate new items.Get the original source file, before any edits.protected InMemoryLargeSourceSetvoidMaintain context about what recipe is performing an edit or generating code.protected InMemoryLargeSourceSetwithChanges(@Nullable Map<SourceFile, List<Recipe>> deletions, List<SourceFile> mapped) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openrewrite.LargeSourceSet
afterCycle, beforeCycle, beforeCycle
-
Constructor Details
-
InMemoryLargeSourceSet
-
InMemoryLargeSourceSet
protected InMemoryLargeSourceSet(@Nullable @Nullable InMemoryLargeSourceSet initialState, @Nullable @Nullable Map<SourceFile, List<Recipe>> deletions, List<SourceFile> ls)
-
-
Method Details
-
withChanges
protected InMemoryLargeSourceSet withChanges(@Nullable @Nullable Map<SourceFile, List<Recipe>> deletions, List<SourceFile> mapped) -
setRecipe
Description copied from interface:LargeSourceSetMaintain context about what recipe is performing an edit or generating code.- Specified by:
setRecipein interfaceLargeSourceSet- 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:LargeSourceSetExecute a transformation on all items.- Specified by:
editin interfaceLargeSourceSet- 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
Description copied from interface:LargeSourceSetConcatenate new items. Where possible, implementations should not iterate the entire source set in order to accomplish this, since the ordering ofSourceFileis not significant.- Specified by:
generatein interfaceLargeSourceSet- Parameters:
t- The new item to insert- Returns:
- A new source set with the new item inserted.
-
getInitialState
-
getChangeset
- Specified by:
getChangesetin interfaceLargeSourceSet- Returns:
- The set of changes (encompassing adds, edits, and deletions) to the initial state.
-
getBefore
Description copied from interface:LargeSourceSetGet the original source file, before any edits. Returns null if it is not present.- Specified by:
getBeforein interfaceLargeSourceSet- Parameters:
sourcePath- The path of the source file to retrieve.- Returns:
- The original source file. Null if not present.
-