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 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 a ModuleContext record class.
      Parameters:
      coordinateResolver - the value for the coordinateResolver record component
      recipeFetcher - the value for the recipeFetcher record component
      moduleAttributes - the value for the moduleAttributes record component
      buildProperties - the value for the buildProperties record component
      configuration - the value for the configuration record component
      configurationByEnvironment - the value for the configurationByEnvironment record component
      bootstrapConfiguration - the value for the bootstrapConfiguration record component
      bootstrapConfigurationByEnvironment - the value for the bootstrapConfigurationByEnvironment record component
      dependencyContext - the value for the dependencyContext record component
      buildPlugins - the value for the buildPlugins record component
      templates - the value for the templates record component
      profiles - the value for the profiles record component
      repositories - the value for the repositories record component
      helpTemplates - the value for the helpTemplates record component
    • ModuleContext

      public ModuleContext(CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher)
    • ModuleContext

      public ModuleContext(String name, CoordinateResolver coordinateResolver, RecipeFetcher recipeFetcher)
  • Method Details

    • addHelpTemplate

      public void addHelpTemplate(Writable writable)
      Adds a template which will be consolidated into a single help file.
      Parameters:
      writable - The template
    • addHelpLink

      public void addHelpLink(String label, String href)
      Ads a Link to a single help file.
      Parameters:
      label - Link's label
      href - Link's uri
    • addDependency

      public void addDependency(@NonNull @NonNull Dependency dependency)
    • getDependencies

      @NonNull public @NonNull Collection<Dependency> getDependencies()
    • getBuildPlugins

      @NonNull public @NonNull Set<BuildPlugin> getBuildPlugins()
      Returns:
      Build plugins
    • addBuildPlugin

      public void addBuildPlugin(@NonNull @NonNull BuildPlugin buildPlugin)
    • getConfigurations

      @NonNull public @NonNull Set<Configuration> getConfigurations()
      Returns:
      All Configurations
    • hasDependencyInScope

      public boolean hasDependencyInScope(@NonNull @NonNull String groupId, @NonNull @NonNull String artifactId, @NonNull @NonNull Scope scope)
      Parameters:
      groupId - Group ID
      artifactId - Artifact ID
      scope - Scope
      Returns:
      Whether the dependency is present
    • addDependenciesByRecipeName

      public void addDependenciesByRecipeName(Options options, String recipeName)
      Parameters:
      recipeName - recipe Name
    • addConfigurationByRecipeName

      public void addConfigurationByRecipeName(@NonNull @NonNull String recipeName)
      Parameters:
      recipeName - recipe Name
    • addBootstrapConfigurationByRecipeName

      public void addBootstrapConfigurationByRecipeName(@NonNull @NonNull String recipeName)
      Parameters:
      recipeName - recipe Name
    • addTemplate

      public void addTemplate(String name, Template template)
      Adds a template.
      Parameters:
      name - The name of the template
      template - The template
    • addTemplate

      public void addTemplate(String templateName, String path, com.fizzed.rocker.RockerModel rockerModel)
    • addTemplate

      public void addTemplate(Options options, String name, String path, TestRockerModelProvider testRockerModelProvider)
      Parameters:
      name - name
      path - path
      testRockerModelProvider - 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 name
      triggerFile - trigger file
      javaTemplate - java template
      kotlinTemplate - kotlin template
      groovyTemplate - groovy template
    • addTemplatesByRecipeName

      public void addTemplatesByRecipeName(String recipeName)
    • removeTemplate

      public void removeTemplate(String name)
      Adds a template.
      Parameters:
      name - The name of the template
    • addProfile

      public void addProfile(@NonNull @NonNull Profile profile)
      Parameters:
      profile - Profile
    • addDependency

      public void addDependency(Dependency.Builder dependencyBuilder)
    • getConfigurationByEnvironmentOrDefaultConfig

      public Configuration getConfigurationByEnvironmentOrDefaultConfig(String env, ApplicationConfiguration defaultConfig)
    • getConfigurationByEnvironment

      public Configuration getConfigurationByEnvironment(String env)
    • getBootstrapConfigurationByEnvironment

      public Configuration getBootstrapConfigurationByEnvironment(String env)
    • getBootstrapConfigurationByEnvironmentOrDefaultConfig

      public Configuration getBootstrapConfigurationByEnvironmentOrDefaultConfig(String env, BootstrapConfiguration defaultConfig)
    • testConfiguration

      public Configuration testConfiguration()
    • devConfiguration

      public Configuration devConfiguration()
    • hasConfigurationByEnvironment

      public boolean hasConfigurationByEnvironment(String env)
    • hasDependency

      public boolean hasDependency(@NonNull @NonNull String groupId, @NonNull @NonNull String artifactId)
      Parameters:
      groupId - Group ID
      artifactId - artifact ID
      Returns:
      Whether the dependency is present
    • countDependencies

      public long countDependencies(@NonNull @NonNull String groupId)
      Parameters:
      groupId - groupID
      Returns:
      number of dependencies with groupId
    • devBootstrapConfiguration

      public Configuration devBootstrapConfiguration()
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • coordinateResolver

      public CoordinateResolver coordinateResolver()
      Returns the value of the coordinateResolver record component.
      Returns:
      the value of the coordinateResolver record component
    • recipeFetcher

      public RecipeFetcher recipeFetcher()
      Returns the value of the recipeFetcher record component.
      Returns:
      the value of the recipeFetcher record component
    • moduleAttributes

      public ModuleAttributes moduleAttributes()
      Returns the value of the moduleAttributes record component.
      Returns:
      the value of the moduleAttributes record component
    • buildProperties

      public BuildProperties buildProperties()
      Returns the value of the buildProperties record component.
      Returns:
      the value of the buildProperties record component
    • configuration

      public ApplicationConfiguration configuration()
      Returns the value of the configuration record component.
      Returns:
      the value of the configuration record component
    • configurationByEnvironment

      public Map<String,ApplicationConfiguration> configurationByEnvironment()
      Returns the value of the configurationByEnvironment record component.
      Returns:
      the value of the configurationByEnvironment record component
    • bootstrapConfiguration

      public BootstrapConfiguration bootstrapConfiguration()
      Returns the value of the bootstrapConfiguration record component.
      Returns:
      the value of the bootstrapConfiguration record component
    • bootstrapConfigurationByEnvironment

      public Map<String,BootstrapConfiguration> bootstrapConfigurationByEnvironment()
      Returns the value of the bootstrapConfigurationByEnvironment record component.
      Returns:
      the value of the bootstrapConfigurationByEnvironment record component
    • dependencyContext

      public DependencyContext dependencyContext()
      Returns the value of the dependencyContext record component.
      Returns:
      the value of the dependencyContext record component
    • buildPlugins

      public Set<BuildPlugin> buildPlugins()
      Returns the value of the buildPlugins record component.
      Returns:
      the value of the buildPlugins record component
    • templates

      public Map<String,Template> templates()
      Returns the value of the templates record component.
      Returns:
      the value of the templates record component
    • profiles

      public Set<Profile> profiles()
      Returns the value of the profiles record component.
      Returns:
      the value of the profiles record component
    • repositories

      public Set<Repository> repositories()
      Returns the value of the repositories record component.
      Returns:
      the value of the repositories record component
    • helpTemplates

      public List<Writable> helpTemplates()
      Returns the value of the helpTemplates record component.
      Returns:
      the value of the helpTemplates record component