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 ThrowingUnaryOperator<T> protected Pathprotected org.openrewrite.marker.Markersprotected booleanprotected booleanprotected @Nullable Path -
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) List<org.openrewrite.marker.Marker> Iterator<SourceSpec<?>> iterator()mapBeforeRecipe(ThrowingUnaryOperator<T> beforeRecipe) 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
-
dir
-
sourcePath
-
markers
protected org.openrewrite.marker.Markers markers -
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
-
getMarkers
-
path
- Parameters:
sourcePath- The source path before the recipe is run.- Returns:
- This source spec.
-
path
- Parameters:
sourcePath- The source path before 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.
-
mapBeforeRecipe
-
beforeRecipe
-
afterRecipe
-
skip
-
skip
-
noTrim
-
noTrim
-
iterator
-