Record Class ModuleContext
java.lang.Object
java.lang.Record
io.micronaut.projectgen.core.generator.ModuleContext
- Record Components:
coordinateResolver- Coordinate resovlerrecipeFetcher- Recipe FetchermoduleAttributes- Module AttributesbuildProperties- Build Propertiesconfiguration- ConfigurationconfigurationByEnvironment- Configuration by environmentbootstrapConfiguration- Bootstrap ConfigurationbootstrapConfigurationByEnvironment- Bootstrap Configuration By EnvironmentdependencyContext- Dependency ContextbuildPlugins- Build Pluginstemplates- Templatesprofiles- Profilesrepositories- RepositorieshelpTemplates- Help Templates
public record ModuleContext(CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher, ModuleAttributes moduleAttributes, BuildProperties buildProperties, ApplicationConfiguration configuration, Map<String,ApplicationConfiguration> configurationByEnvironment, BootstrapConfiguration bootstrapConfiguration, Map<String,BootstrapConfiguration> bootstrapConfigurationByEnvironment, DependencyContext dependencyContext, Set<BuildPlugin> buildPlugins, Map<String,Template> templates, Set<Profile> profiles, Set<Repository> repositories, List<Writable> helpTemplates)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionModuleContext(CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher) ModuleContext(CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher, ModuleAttributes moduleAttributes, BuildProperties buildProperties, ApplicationConfiguration configuration, Map<String, ApplicationConfiguration> configurationByEnvironment, BootstrapConfiguration bootstrapConfiguration, Map<String, BootstrapConfiguration> bootstrapConfigurationByEnvironment, DependencyContext dependencyContext, Set<BuildPlugin> buildPlugins, Map<String, Template> templates, Set<Profile> profiles, Set<Repository> repositories, List<Writable> helpTemplates) Creates an instance of aModuleContextrecord class.ModuleContext(String name, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBootstrapConfigurationByRecipeName(@NonNull String recipeName) voidaddBuildPlugin(@NonNull BuildPlugin buildPlugin) voidaddBuildPluginsByRecipeName(Options options, String recipeName) voidaddConfigurationByRecipeName(@NonNull String recipeName) voidaddDependenciesByRecipeName(Options options, String recipeName) voidaddDependency(@NonNull Dependency dependency) voidaddDependency(Dependency.Builder dependencyBuilder) voidaddDependencyOnlyForBuild(Dependency.Builder dependencyBuilder, BuildTool buildTool) voidaddDependencyOnlyForBuild(Dependency dependency, BuildTool buildTool) voidaddDevConfigurationByRecipeName(@NonNull String recipeName) voidaddHelpLink(String label, String href) Ads a Link to a single help file.voidaddHelpTemplate(Writable writable) Adds a template which will be consolidated into a single help file.voidaddMavenBuildPropertiesByRecipeName(@NonNull String recipeName) voidaddProfile(@NonNull Profile profile) voidaddTemplate(Language language, String templateName, String triggerFile, com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) voidaddTemplate(Options options, String name, String path, TestRockerModelProvider testRockerModelProvider) voidaddTemplate(String name, Template template) Adds a template.voidaddTemplate(String templateName, String path, com.fizzed.rocker.RockerModel rockerModel) voidaddTemplatesByRecipeName(String recipeName) Returns the value of thebootstrapConfigurationrecord component.Returns the value of thebootstrapConfigurationByEnvironmentrecord component.Returns the value of thebuildPluginsrecord component.Returns the value of thebuildPropertiesrecord component.Returns the value of theconfigurationrecord component.Returns the value of theconfigurationByEnvironmentrecord component.Returns the value of thecoordinateResolverrecord component.longcountDependencies(@NonNull String groupId) Returns the value of thedependencyContextrecord component.final booleanIndicates whether some other object is "equal to" this one.getBootstrapConfigurationByEnvironmentOrDefaultConfig(String env, BootstrapConfiguration defaultConfig) @NonNull Set<BuildPlugin>getConfigurationByEnvironmentOrDefaultConfig(String env, ApplicationConfiguration defaultConfig) @NonNull Set<Configuration>@NonNull Collection<Dependency>@NonNull Collection<Dependency>getDependenciesByBuildTool(@NonNull BuildTool buildTool) booleanbooleanhasDependency(@NonNull String groupId, @NonNull String artifactId) booleanhasDependencyInScope(@NonNull String groupId, @NonNull String artifactId, @NonNull Scope scope) final inthashCode()Returns a hash code value for this object.Returns the value of thehelpTemplatesrecord component.Returns the value of themoduleAttributesrecord component.profiles()Returns the value of theprofilesrecord component.Returns the value of therecipeFetcherrecord component.voidremoveTemplate(String name) Adds a template.Returns the value of therepositoriesrecord component.Returns the value of thetemplatesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ModuleContext
public ModuleContext(CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher, ModuleAttributes moduleAttributes, BuildProperties buildProperties, ApplicationConfiguration configuration, Map<String, ApplicationConfiguration> configurationByEnvironment, BootstrapConfiguration bootstrapConfiguration, Map<String, BootstrapConfiguration> bootstrapConfigurationByEnvironment, DependencyContext dependencyContext, Set<BuildPlugin> buildPlugins, Map<String, Template> templates, Set<Profile> profiles, Set<Repository> repositories, List<Writable> helpTemplates) Creates an instance of aModuleContextrecord class.- Parameters:
coordinateResolver- the value for thecoordinateResolverrecord componentrecipeFetcher- the value for therecipeFetcherrecord componentmoduleAttributes- the value for themoduleAttributesrecord componentbuildProperties- the value for thebuildPropertiesrecord componentconfiguration- the value for theconfigurationrecord componentconfigurationByEnvironment- the value for theconfigurationByEnvironmentrecord componentbootstrapConfiguration- the value for thebootstrapConfigurationrecord componentbootstrapConfigurationByEnvironment- the value for thebootstrapConfigurationByEnvironmentrecord componentdependencyContext- the value for thedependencyContextrecord componentbuildPlugins- the value for thebuildPluginsrecord componenttemplates- the value for thetemplatesrecord componentprofiles- the value for theprofilesrecord componentrepositories- the value for therepositoriesrecord componenthelpTemplates- the value for thehelpTemplatesrecord component
-
ModuleContext
-
ModuleContext
public ModuleContext(String name, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher)
-
-
Method Details
-
addHelpTemplate
Adds a template which will be consolidated into a single help file.- Parameters:
writable- The template
-
addHelpLink
Ads a Link to a single help file.- Parameters:
label- Link's labelhref- Link's uri
-
getBuildPlugins
- Returns:
- Build plugins
-
addBuildPlugin
-
getConfigurations
- Returns:
- All Configurations
-
hasDependencyInScope
public boolean hasDependencyInScope(@NonNull @NonNull String groupId, @NonNull @NonNull String artifactId, @NonNull @NonNull Scope scope) - Parameters:
groupId- Group IDartifactId- Artifact IDscope- Scope- Returns:
- Whether the dependency is present
-
addDependenciesByRecipeName
- Parameters:
recipeName- recipe Name
-
addBuildPluginsByRecipeName
-
addConfigurationByRecipeName
- Parameters:
recipeName- recipe Name
-
addBootstrapConfigurationByRecipeName
- Parameters:
recipeName- recipe Name
-
addDevConfigurationByRecipeName
-
addMavenBuildPropertiesByRecipeName
-
addTemplate
Adds a template.- Parameters:
name- The name of the templatetemplate- The template
-
addTemplate
-
addTemplate
public void addTemplate(Options options, String name, String path, TestRockerModelProvider testRockerModelProvider) - Parameters:
name- namepath- pathtestRockerModelProvider- testRockerModelProvider
-
addTemplate
public void addTemplate(Language language, String templateName, String triggerFile, com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) - Parameters:
templateName- template nametriggerFile- trigger filejavaTemplate- java templatekotlinTemplate- kotlin templategroovyTemplate- groovy template
-
addTemplatesByRecipeName
-
removeTemplate
Adds a template.- Parameters:
name- The name of the template
-
addProfile
- Parameters:
profile- Profile
-
addDependency
-
getDependencies
-
getDependenciesByBuildTool
@NonNull public @NonNull Collection<Dependency> getDependenciesByBuildTool(@NonNull @NonNull BuildTool buildTool) -
addDependency
-
addDependencyOnlyForBuild
-
addDependencyOnlyForBuild
-
getConfigurationByEnvironmentOrDefaultConfig
public Configuration getConfigurationByEnvironmentOrDefaultConfig(String env, ApplicationConfiguration defaultConfig) -
getConfigurationByEnvironment
-
getBootstrapConfigurationByEnvironment
-
getBootstrapConfigurationByEnvironmentOrDefaultConfig
public Configuration getBootstrapConfigurationByEnvironmentOrDefaultConfig(String env, BootstrapConfiguration defaultConfig) -
testConfiguration
-
devConfiguration
-
hasConfigurationByEnvironment
-
hasDependency
- Parameters:
groupId- Group IDartifactId- artifact ID- Returns:
- Whether the dependency is present
-
countDependencies
- Parameters:
groupId- groupID- Returns:
- number of dependencies with groupId
-
devBootstrapConfiguration
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
coordinateResolver
Returns the value of thecoordinateResolverrecord component.- Returns:
- the value of the
coordinateResolverrecord component
-
recipeFetcher
Returns the value of therecipeFetcherrecord component.- Returns:
- the value of the
recipeFetcherrecord component
-
moduleAttributes
Returns the value of themoduleAttributesrecord component.- Returns:
- the value of the
moduleAttributesrecord component
-
buildProperties
Returns the value of thebuildPropertiesrecord component.- Returns:
- the value of the
buildPropertiesrecord component
-
configuration
Returns the value of theconfigurationrecord component.- Returns:
- the value of the
configurationrecord component
-
configurationByEnvironment
Returns the value of theconfigurationByEnvironmentrecord component.- Returns:
- the value of the
configurationByEnvironmentrecord component
-
bootstrapConfiguration
Returns the value of thebootstrapConfigurationrecord component.- Returns:
- the value of the
bootstrapConfigurationrecord component
-
bootstrapConfigurationByEnvironment
Returns the value of thebootstrapConfigurationByEnvironmentrecord component.- Returns:
- the value of the
bootstrapConfigurationByEnvironmentrecord component
-
dependencyContext
Returns the value of thedependencyContextrecord component.- Returns:
- the value of the
dependencyContextrecord component
-
buildPlugins
Returns the value of thebuildPluginsrecord component.- Returns:
- the value of the
buildPluginsrecord component
-
templates
Returns the value of thetemplatesrecord component.- Returns:
- the value of the
templatesrecord component
-
profiles
Returns the value of theprofilesrecord component.- Returns:
- the value of the
profilesrecord component
-
repositories
Returns the value of therepositoriesrecord component.- Returns:
- the value of the
repositoriesrecord component
-
helpTemplates
Returns the value of thehelpTemplatesrecord component.- Returns:
- the value of the
helpTemplatesrecord component
-