Package org.openrewrite.internal
Class InMemoryLargeSourceSet
java.lang.Object
org.openrewrite.internal.InMemoryLargeSourceSet
- All Implemented Interfaces:
LargeSourceSet
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedit(UnaryOperator<SourceFile> map) Execute a transformation on all items.generate(@Nullable Collection<? extends SourceFile> t) Concatenate new items.voidMaintain context about what recipe is performing an edit or generating code.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
-
Constructor Details
-
InMemoryLargeSourceSet
-
-
Method Details
-
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.
-
getChangeset
- Specified by:
getChangesetin interfaceLargeSourceSet- Returns:
- The set of changes (encompassing adds, edits, and deletions) to the initial state.
-