Class MinConfiguration

java.lang.Object
com.io7m.minisite.core.MinConfiguration
All Implemented Interfaces:
MinConfigurationType

public final class MinConfiguration extends Object implements MinConfigurationType
Configurations for sites.
  • Method Details

    • projectName

      public String projectName()
      Specified by:
      projectName in interface MinConfigurationType
      Returns:
      The name of the project
    • projectGroupName

      public String projectGroupName()
      Specified by:
      projectGroupName in interface MinConfigurationType
      Returns:
      The group name of the project
    • projectModules

      public List<String> projectModules()
      Specified by:
      projectModules in interface MinConfigurationType
      Returns:
      The project modules
    • release

      public String release()
      Specified by:
      release in interface MinConfigurationType
      Returns:
      The version number of the current release
    • centralReposPath

      public String centralReposPath()
      Specified by:
      centralReposPath in interface MinConfigurationType
      Returns:
      The path to the project within the Central Repository
    • header

      public Optional<Path> header()
      Specified by:
      header in interface MinConfigurationType
      Returns:
      An XHTML file containing a header inserted above the title and logo in generated sites.
    • overview

      public Optional<Path> overview()
      Specified by:
      overview in interface MinConfigurationType
      Returns:
      An XHTML file containing an overview of the project
    • features

      public Optional<Path> features()
      Specified by:
      features in interface MinConfigurationType
      Returns:
      An XHTML file containing the features of the project
    • documentation

      public Optional<Path> documentation()
      Specified by:
      documentation in interface MinConfigurationType
      Returns:
      An XHTML file containing the documentation links of the project
    • changelog

      public Optional<MinChangesConfiguration> changelog()
      Specified by:
      changelog in interface MinConfigurationType
      Returns:
      The changelog configuration, if any
    • license

      public Optional<Path> license()
      Specified by:
      license in interface MinConfigurationType
      Returns:
      A plain text file containing the project license
    • bugTracker

      public Optional<MinBugTrackerConfiguration> bugTracker()
      Specified by:
      bugTracker in interface MinConfigurationType
      Returns:
      The bug tracker configuration, if any
    • sources

      public Optional<MinSourcesConfiguration> sources()
      Specified by:
      sources in interface MinConfigurationType
      Returns:
      The project source configuration, if any
    • cssIncludes

      public List<String> cssIncludes()
      Specified by:
      cssIncludes in interface MinConfigurationType
      Returns:
      The list of stylesheets that will be included by the generated site
    • cssGenerateStyle

      public boolean cssGenerateStyle()
      Specified by:
      cssGenerateStyle in interface MinConfigurationType
      Returns:
      true if the default style should be copied to the generated site directory
    • withProjectName

      public final MinConfiguration withProjectName(String value)
      Copy the current immutable object by setting a value for the projectName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for projectName
      Returns:
      A modified copy of the this object
    • withProjectGroupName

      public final MinConfiguration withProjectGroupName(String value)
      Copy the current immutable object by setting a value for the projectGroupName attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for projectGroupName
      Returns:
      A modified copy of the this object
    • withProjectModules

      public final MinConfiguration withProjectModules(String... elements)
      Copy the current immutable object with elements that replace the content of projectModules.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withProjectModules

      public final MinConfiguration withProjectModules(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of projectModules. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of projectModules elements to set
      Returns:
      A modified copy of this object
    • withRelease

      public final MinConfiguration withRelease(String value)
      Copy the current immutable object by setting a value for the release attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for release
      Returns:
      A modified copy of the this object
    • withCentralReposPath

      public final MinConfiguration withCentralReposPath(String value)
      Copy the current immutable object by setting a value for the centralReposPath attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for centralReposPath
      Returns:
      A modified copy of the this object
    • withHeader

      public final MinConfiguration withHeader(Path value)
      Copy the current immutable object by setting a present value for the optional header attribute.
      Parameters:
      value - The value for header
      Returns:
      A modified copy of this object
    • withHeader

      public final MinConfiguration withHeader(Optional<? extends Path> optional)
      Copy the current immutable object by setting an optional value for the header attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for header
      Returns:
      A modified copy of this object
    • withOverview

      public final MinConfiguration withOverview(Path value)
      Copy the current immutable object by setting a present value for the optional overview attribute.
      Parameters:
      value - The value for overview
      Returns:
      A modified copy of this object
    • withOverview

      public final MinConfiguration withOverview(Optional<? extends Path> optional)
      Copy the current immutable object by setting an optional value for the overview attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for overview
      Returns:
      A modified copy of this object
    • withFeatures

      public final MinConfiguration withFeatures(Path value)
      Copy the current immutable object by setting a present value for the optional features attribute.
      Parameters:
      value - The value for features
      Returns:
      A modified copy of this object
    • withFeatures

      public final MinConfiguration withFeatures(Optional<? extends Path> optional)
      Copy the current immutable object by setting an optional value for the features attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for features
      Returns:
      A modified copy of this object
    • withDocumentation

      public final MinConfiguration withDocumentation(Path value)
      Copy the current immutable object by setting a present value for the optional documentation attribute.
      Parameters:
      value - The value for documentation
      Returns:
      A modified copy of this object
    • withDocumentation

      public final MinConfiguration withDocumentation(Optional<? extends Path> optional)
      Copy the current immutable object by setting an optional value for the documentation attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for documentation
      Returns:
      A modified copy of this object
    • withChangelog

      public final MinConfiguration withChangelog(MinChangesConfiguration value)
      Copy the current immutable object by setting a present value for the optional changelog attribute.
      Parameters:
      value - The value for changelog
      Returns:
      A modified copy of this object
    • withChangelog

      public final MinConfiguration withChangelog(Optional<? extends MinChangesConfiguration> optional)
      Copy the current immutable object by setting an optional value for the changelog attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for changelog
      Returns:
      A modified copy of this object
    • withLicense

      public final MinConfiguration withLicense(Path value)
      Copy the current immutable object by setting a present value for the optional license attribute.
      Parameters:
      value - The value for license
      Returns:
      A modified copy of this object
    • withLicense

      public final MinConfiguration withLicense(Optional<? extends Path> optional)
      Copy the current immutable object by setting an optional value for the license attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for license
      Returns:
      A modified copy of this object
    • withBugTracker

      public final MinConfiguration withBugTracker(MinBugTrackerConfiguration value)
      Copy the current immutable object by setting a present value for the optional bugTracker attribute.
      Parameters:
      value - The value for bugTracker
      Returns:
      A modified copy of this object
    • withBugTracker

      public final MinConfiguration withBugTracker(Optional<? extends MinBugTrackerConfiguration> optional)
      Copy the current immutable object by setting an optional value for the bugTracker attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for bugTracker
      Returns:
      A modified copy of this object
    • withSources

      public final MinConfiguration withSources(MinSourcesConfiguration value)
      Copy the current immutable object by setting a present value for the optional sources attribute.
      Parameters:
      value - The value for sources
      Returns:
      A modified copy of this object
    • withSources

      public final MinConfiguration withSources(Optional<? extends MinSourcesConfiguration> optional)
      Copy the current immutable object by setting an optional value for the sources attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for sources
      Returns:
      A modified copy of this object
    • withCssIncludes

      public final MinConfiguration withCssIncludes(String... elements)
      Copy the current immutable object with elements that replace the content of cssIncludes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCssIncludes

      public final MinConfiguration withCssIncludes(Iterable<String> elements)
      Copy the current immutable object with elements that replace the content of cssIncludes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of cssIncludes elements to set
      Returns:
      A modified copy of this object
    • withCssGenerateStyle

      public final MinConfiguration withCssGenerateStyle(boolean value)
      Copy the current immutable object by setting a value for the cssGenerateStyle attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for cssGenerateStyle
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(Object another)
      This instance is equal to all instances of MinConfiguration that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: projectName, projectGroupName, projectModules, release, centralReposPath, header, overview, features, documentation, changelog, license, bugTracker, sources, cssIncludes, cssGenerateStyle.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value MinConfiguration with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • of

      public static MinConfiguration of(String projectName, String projectGroupName, List<String> projectModules, String release, String centralReposPath, Optional<Path> header, Optional<Path> overview, Optional<Path> features, Optional<Path> documentation, Optional<MinChangesConfiguration> changelog, Optional<Path> license, Optional<MinBugTrackerConfiguration> bugTracker, Optional<MinSourcesConfiguration> sources, List<String> cssIncludes, boolean cssGenerateStyle)
      Construct a new immutable MinConfiguration instance.
      Parameters:
      projectName - The value for the projectName attribute
      projectGroupName - The value for the projectGroupName attribute
      projectModules - The value for the projectModules attribute
      release - The value for the release attribute
      centralReposPath - The value for the centralReposPath attribute
      header - The value for the header attribute
      overview - The value for the overview attribute
      features - The value for the features attribute
      documentation - The value for the documentation attribute
      changelog - The value for the changelog attribute
      license - The value for the license attribute
      bugTracker - The value for the bugTracker attribute
      sources - The value for the sources attribute
      cssIncludes - The value for the cssIncludes attribute
      cssGenerateStyle - The value for the cssGenerateStyle attribute
      Returns:
      An immutable MinConfiguration instance
    • of

      public static MinConfiguration of(String projectName, String projectGroupName, Iterable<String> projectModules, String release, String centralReposPath, Optional<? extends Path> header, Optional<? extends Path> overview, Optional<? extends Path> features, Optional<? extends Path> documentation, Optional<? extends MinChangesConfiguration> changelog, Optional<? extends Path> license, Optional<? extends MinBugTrackerConfiguration> bugTracker, Optional<? extends MinSourcesConfiguration> sources, Iterable<String> cssIncludes, boolean cssGenerateStyle)
      Construct a new immutable MinConfiguration instance.
      Parameters:
      projectName - The value for the projectName attribute
      projectGroupName - The value for the projectGroupName attribute
      projectModules - The value for the projectModules attribute
      release - The value for the release attribute
      centralReposPath - The value for the centralReposPath attribute
      header - The value for the header attribute
      overview - The value for the overview attribute
      features - The value for the features attribute
      documentation - The value for the documentation attribute
      changelog - The value for the changelog attribute
      license - The value for the license attribute
      bugTracker - The value for the bugTracker attribute
      sources - The value for the sources attribute
      cssIncludes - The value for the cssIncludes attribute
      cssGenerateStyle - The value for the cssGenerateStyle attribute
      Returns:
      An immutable MinConfiguration instance
    • copyOf

      public static MinConfiguration copyOf(MinConfigurationType instance)
      Creates an immutable copy of a MinConfigurationType value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable MinConfiguration instance
    • builder

      public static MinConfiguration.Builder builder()
      Creates a builder for MinConfiguration.
       MinConfiguration.builder()
          .setProjectName(String) // required projectName
          .setProjectGroupName(String) // required projectGroupName
          .addProjectModules|addAllProjectModules(String) // projectModules elements
          .setRelease(String) // required release
          .setCentralReposPath(String) // required centralReposPath
          .setHeader(java.nio.file.Path) // optional header
          .setOverview(java.nio.file.Path) // optional overview
          .setFeatures(java.nio.file.Path) // optional features
          .setDocumentation(java.nio.file.Path) // optional documentation
          .setChangelog(MinChangesConfiguration) // optional changelog
          .setLicense(java.nio.file.Path) // optional license
          .setBugTracker(MinBugTrackerConfiguration) // optional bugTracker
          .setSources(MinSourcesConfiguration) // optional sources
          .addCssIncludes|addAllCssIncludes(String) // cssIncludes elements
          .setCssGenerateStyle(boolean) // optional cssGenerateStyle
          .build();
       
      Returns:
      A new MinConfiguration builder