Record Class ModuleContext
java.lang.Object
java.lang.Record
io.micronaut.projectgen.core.generator.ModuleContext
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 aModuleContext
record class.ModuleContext
(String name, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBootstrapConfigurationByRecipeName
(@NonNull String recipeName) void
addBuildPlugin
(@NonNull BuildPlugin buildPlugin) void
addConfigurationByRecipeName
(@NonNull String recipeName) void
addDependenciesByRecipeName
(Options options, String recipeName) void
addDependency
(@NonNull Dependency dependency) void
addDependency
(Dependency.Builder dependencyBuilder) void
addHelpLink
(String label, String href) Ads a Link to a single help file.void
addHelpTemplate
(Writable writable) Adds a template which will be consolidated into a single help file.void
addProfile
(@NonNull Profile profile) void
addTemplate
(Language language, String templateName, String triggerFile, com.fizzed.rocker.RockerModel javaTemplate, com.fizzed.rocker.RockerModel kotlinTemplate, com.fizzed.rocker.RockerModel groovyTemplate) void
addTemplate
(Options options, String name, String path, TestRockerModelProvider testRockerModelProvider) void
addTemplate
(String name, Template template) Adds a template.void
addTemplate
(String templateName, String path, com.fizzed.rocker.RockerModel rockerModel) void
addTemplatesByRecipeName
(String recipeName) Returns the value of thebootstrapConfiguration
record component.Returns the value of thebootstrapConfigurationByEnvironment
record component.Returns the value of thebuildPlugins
record component.Returns the value of thebuildProperties
record component.Returns the value of theconfiguration
record component.Returns the value of theconfigurationByEnvironment
record component.Returns the value of thecoordinateResolver
record component.long
countDependencies
(@NonNull String groupId) Returns the value of thedependencyContext
record component.final boolean
Indicates 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>
boolean
boolean
hasDependency
(@NonNull String groupId, @NonNull String artifactId) boolean
hasDependencyInScope
(@NonNull String groupId, @NonNull String artifactId, @NonNull Scope scope) final int
hashCode()
Returns a hash code value for this object.Returns the value of thehelpTemplates
record component.Returns the value of themoduleAttributes
record component.profiles()
Returns the value of theprofiles
record component.Returns the value of therecipeFetcher
record component.void
removeTemplate
(String name) Adds a template.Returns the value of therepositories
record component.Returns the value of thetemplates
record component.final String
toString()
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 aModuleContext
record class.- Parameters:
coordinateResolver
- the value for thecoordinateResolver
record componentrecipeFetcher
- the value for therecipeFetcher
record componentmoduleAttributes
- the value for themoduleAttributes
record componentbuildProperties
- the value for thebuildProperties
record componentconfiguration
- the value for theconfiguration
record componentconfigurationByEnvironment
- the value for theconfigurationByEnvironment
record componentbootstrapConfiguration
- the value for thebootstrapConfiguration
record componentbootstrapConfigurationByEnvironment
- the value for thebootstrapConfigurationByEnvironment
record componentdependencyContext
- the value for thedependencyContext
record componentbuildPlugins
- the value for thebuildPlugins
record componenttemplates
- the value for thetemplates
record componentprofiles
- the value for theprofiles
record componentrepositories
- the value for therepositories
record componenthelpTemplates
- the value for thehelpTemplates
record 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
-
addDependency
-
getDependencies
-
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
-
addConfigurationByRecipeName
- Parameters:
recipeName
- recipe Name
-
addBootstrapConfigurationByRecipeName
- Parameters:
recipeName
- recipe Name
-
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
-
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 thecoordinateResolver
record component.- Returns:
- the value of the
coordinateResolver
record component
-
recipeFetcher
Returns the value of therecipeFetcher
record component.- Returns:
- the value of the
recipeFetcher
record component
-
moduleAttributes
Returns the value of themoduleAttributes
record component.- Returns:
- the value of the
moduleAttributes
record component
-
buildProperties
Returns the value of thebuildProperties
record component.- Returns:
- the value of the
buildProperties
record component
-
configuration
Returns the value of theconfiguration
record component.- Returns:
- the value of the
configuration
record component
-
configurationByEnvironment
Returns the value of theconfigurationByEnvironment
record component.- Returns:
- the value of the
configurationByEnvironment
record component
-
bootstrapConfiguration
Returns the value of thebootstrapConfiguration
record component.- Returns:
- the value of the
bootstrapConfiguration
record component
-
bootstrapConfigurationByEnvironment
Returns the value of thebootstrapConfigurationByEnvironment
record component.- Returns:
- the value of the
bootstrapConfigurationByEnvironment
record component
-
dependencyContext
Returns the value of thedependencyContext
record component.- Returns:
- the value of the
dependencyContext
record component
-
buildPlugins
Returns the value of thebuildPlugins
record component.- Returns:
- the value of the
buildPlugins
record component
-
templates
Returns the value of thetemplates
record component.- Returns:
- the value of the
templates
record component
-
profiles
Returns the value of theprofiles
record component.- Returns:
- the value of the
profiles
record component
-
repositories
Returns the value of therepositories
record component.- Returns:
- the value of the
repositories
record component
-
helpTemplates
Returns the value of thehelpTemplates
record component.- Returns:
- the value of the
helpTemplates
record component
-