public class ClassProvider extends Object
ClassProvider.ProvideFrom enum. The
Generator uses this to determine merge classes and input classes.| Modifier and Type | Class and Description |
|---|---|
static class |
ClassProvider.ProvideFrom
Determines what the
Generator should provide as input to the ClassProvider to determine the path to the merge class. |
| Constructor and Description |
|---|
ClassProvider()
Provider to return the same class as the input class.
|
ClassProvider(ClassProvider.ProvideFrom provideFrom,
java.util.function.Function<String,String> provide)
Provider to create a custom path to a class after receiving a path from the given
ClassProvider.ProvideFrom. |
ClassProvider(String path)
Provider to return the class defined by the input path.
|
| Modifier and Type | Method and Description |
|---|---|
static ClassProvider |
forMavenUnitTestFromInput()
Calculates the path of the maven unit test by replacing 'main' with 'test' and replacing '.java' with 'Test.java'.
|
static ClassProvider |
forMavenUnitTestFromParent()
Calculates the path of the maven unit test by replacing 'main' with 'test' and replacing '.java' with 'Test.java'.
|
static ClassProvider |
fromInputClass(java.util.function.Function<String,String> provider)
Provider to create a custom path to a class after receiving the path to the input class.
|
static ClassProvider |
fromParentMergeClass() |
static ClassProvider |
fromParentMergeClass(java.util.function.Function<String,String> provider)
Provider to create a custom path to a class after receiving the path to the merge class from the parent
JavaForgerConfiguration. |
String |
provide(String path)
Calculates the path to the class given the input path.
|
String |
provide(String parentInputClass,
String parentMergeClass)
Selects one of the 2 input values depending on the
ClassProvider.ProvideFrom that was set. |
ClassProvider.ProvideFrom |
provideFrom()
Defines what the provider requires as input to provide the output class.
|
static ClassProvider |
sameAsParentMergeClass()
Provider to provide the class to which the parent
JavaForgerConfiguration was merged. |
public ClassProvider()
public ClassProvider(String path)
path - The path to the class to merge with.public ClassProvider(ClassProvider.ProvideFrom provideFrom, java.util.function.Function<String,String> provide)
ClassProvider.ProvideFrom.provideFrom - The ClassProvider.ProvideFrom defining where the input path should be taken from.provide - The provider for determining the output path after receiving the input path.public static ClassProvider fromInputClass(java.util.function.Function<String,String> provider)
provider - The provider for determining the output path after receiving the input path.ClassProviderpublic static ClassProvider fromParentMergeClass()
JavaForgerConfiguration was merged.public static ClassProvider fromParentMergeClass(java.util.function.Function<String,String> provider)
JavaForgerConfiguration.provider - The provider for determining the output path after receiving the input path.ClassProviderpublic static ClassProvider forMavenUnitTestFromInput()
public static ClassProvider forMavenUnitTestFromParent()
public static ClassProvider sameAsParentMergeClass()
JavaForgerConfiguration was merged.public String provide(String path)
path - The input path.public String provide(String parentInputClass, String parentMergeClass)
ClassProvider.ProvideFrom that was set. Then uses that input to calculate the new path.parentInputClass - The input path.parentMergeClass - Path to the merge class to which the parent JavaForgerConfiguration was merged.public ClassProvider.ProvideFrom provideFrom()
ClassProvider.ProvideFromCopyright © 2019. All rights reserved.