Package org.openrewrite.test
Class SourceSpec<T extends org.openrewrite.SourceFile>
java.lang.Object
org.openrewrite.test.SourceSpec<T>
- All Implemented Interfaces:
Iterable<SourceSpec<?>>,SourceSpecs
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.openrewrite.internal.ThrowingConsumer<T>protected org.openrewrite.internal.ThrowingConsumer<T>protected Pathprotected final List<org.openrewrite.marker.Marker>protected booleanprotected booleanprotected @Nullable Pathprotected @Nullable String -
Constructor Summary
ConstructorsConstructorDescriptionSourceSpec(Class<T> sourceFileType, @Nullable String dsl, org.openrewrite.Parser.Builder parser, @Nullable String before, @Nullable UnaryOperator<String> after) -
Method Summary
Modifier and TypeMethodDescriptionafter(UnaryOperator<String> after) Apply a function to specify what the after text of a recipe run should be.afterRecipe(org.openrewrite.internal.ThrowingConsumer<T> afterRecipe) beforeRecipe(org.openrewrite.internal.ThrowingConsumer<T> beforeRecipe) Iterator<SourceSpec<?>>iterator()markers(org.openrewrite.marker.Marker... markers) noTrim()skip()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
sourceSetName
-
dir
-
sourcePath
-
markers
-
beforeRecipe
protected org.openrewrite.internal.ThrowingConsumer<T extends org.openrewrite.SourceFile> beforeRecipe -
afterRecipe
protected org.openrewrite.internal.ThrowingConsumer<T extends org.openrewrite.SourceFile> afterRecipe -
skip
protected boolean skip -
noTrim
protected boolean noTrim
-
-
Constructor Details
-
SourceSpec
-
-
Method Details
-
path
- Parameters:
sourcePath- The source path after the recipe is run.- Returns:
- This source spec.
-
path
- Parameters:
sourcePath- The source path after the recipe is run.- Returns:
- This source spec.
-
markers
-
after
Apply a function to specify what the after text of a recipe run should be.- Parameters:
after- A unary operator that takes the actual result and returns the expected result. The actual result can be used to pull out things that are dynamic, like timestamps or dependency versions that may change between runs.- Returns:
- This source spec.
-
beforeRecipe
-
afterRecipe
-
skip
-
skip
-
noTrim
-
noTrim
-
iterator
-