Package com.io7m.minisite.core
Class MinConfiguration
java.lang.Object
com.io7m.minisite.core.MinConfiguration
- All Implemented Interfaces:
MinConfigurationType
public final class MinConfiguration extends java.lang.Object implements MinConfigurationType
Configurations for sites.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMinConfiguration.BuilderBuilds instances of typeMinConfiguration. -
Method Summary
Modifier and Type Method Description java.util.Optional<MinBugTrackerConfiguration>bugTracker()static MinConfiguration.Builderbuilder()Creates a builder forMinConfiguration.java.lang.StringcentralReposPath()java.util.Optional<MinChangesConfiguration>changelog()static MinConfigurationcopyOf(MinConfigurationType instance)Creates an immutable copy of aMinConfigurationTypevalue.booleancssGenerateStyle()java.util.List<java.lang.String>cssIncludes()java.util.Optional<java.nio.file.Path>documentation()booleanequals(java.lang.Object another)This instance is equal to all instances ofMinConfigurationthat have equal attribute values.java.util.Optional<java.nio.file.Path>features()inthashCode()Computes a hash code from attributes:projectName,projectGroupName,projectModules,release,centralReposPath,header,overview,features,documentation,changelog,license,bugTracker,sources,cssIncludes,cssGenerateStyle.java.util.Optional<java.nio.file.Path>header()java.util.Optional<java.nio.file.Path>license()static MinConfigurationof(java.lang.String projectName, java.lang.String projectGroupName, java.lang.Iterable<java.lang.String> projectModules, java.lang.String release, java.lang.String centralReposPath, java.util.Optional<? extends java.nio.file.Path> header, java.util.Optional<? extends java.nio.file.Path> overview, java.util.Optional<? extends java.nio.file.Path> features, java.util.Optional<? extends java.nio.file.Path> documentation, java.util.Optional<? extends MinChangesConfiguration> changelog, java.util.Optional<? extends java.nio.file.Path> license, java.util.Optional<? extends MinBugTrackerConfiguration> bugTracker, java.util.Optional<? extends MinSourcesConfiguration> sources, java.lang.Iterable<java.lang.String> cssIncludes, boolean cssGenerateStyle)Construct a new immutableMinConfigurationinstance.static MinConfigurationof(java.lang.String projectName, java.lang.String projectGroupName, java.util.List<java.lang.String> projectModules, java.lang.String release, java.lang.String centralReposPath, java.util.Optional<java.nio.file.Path> header, java.util.Optional<java.nio.file.Path> overview, java.util.Optional<java.nio.file.Path> features, java.util.Optional<java.nio.file.Path> documentation, java.util.Optional<MinChangesConfiguration> changelog, java.util.Optional<java.nio.file.Path> license, java.util.Optional<MinBugTrackerConfiguration> bugTracker, java.util.Optional<MinSourcesConfiguration> sources, java.util.List<java.lang.String> cssIncludes, boolean cssGenerateStyle)Construct a new immutableMinConfigurationinstance.java.util.Optional<java.nio.file.Path>overview()java.lang.StringprojectGroupName()java.util.List<java.lang.String>projectModules()java.lang.StringprojectName()java.lang.Stringrelease()java.util.Optional<MinSourcesConfiguration>sources()java.lang.StringtoString()Prints the immutable valueMinConfigurationwith attribute values.MinConfigurationwithBugTracker(MinBugTrackerConfiguration value)Copy the current immutable object by setting a present value for the optionalbugTrackerattribute.MinConfigurationwithBugTracker(java.util.Optional<? extends MinBugTrackerConfiguration> optional)Copy the current immutable object by setting an optional value for thebugTrackerattribute.MinConfigurationwithCentralReposPath(java.lang.String value)Copy the current immutable object by setting a value for thecentralReposPathattribute.MinConfigurationwithChangelog(MinChangesConfiguration value)Copy the current immutable object by setting a present value for the optionalchangelogattribute.MinConfigurationwithChangelog(java.util.Optional<? extends MinChangesConfiguration> optional)Copy the current immutable object by setting an optional value for thechangelogattribute.MinConfigurationwithCssGenerateStyle(boolean value)Copy the current immutable object by setting a value for thecssGenerateStyleattribute.MinConfigurationwithCssIncludes(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofcssIncludes.MinConfigurationwithCssIncludes(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofcssIncludes.MinConfigurationwithDocumentation(java.nio.file.Path value)Copy the current immutable object by setting a present value for the optionaldocumentationattribute.MinConfigurationwithDocumentation(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thedocumentationattribute.MinConfigurationwithFeatures(java.nio.file.Path value)Copy the current immutable object by setting a present value for the optionalfeaturesattribute.MinConfigurationwithFeatures(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thefeaturesattribute.MinConfigurationwithHeader(java.nio.file.Path value)Copy the current immutable object by setting a present value for the optionalheaderattribute.MinConfigurationwithHeader(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for theheaderattribute.MinConfigurationwithLicense(java.nio.file.Path value)Copy the current immutable object by setting a present value for the optionallicenseattribute.MinConfigurationwithLicense(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thelicenseattribute.MinConfigurationwithOverview(java.nio.file.Path value)Copy the current immutable object by setting a present value for the optionaloverviewattribute.MinConfigurationwithOverview(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for theoverviewattribute.MinConfigurationwithProjectGroupName(java.lang.String value)Copy the current immutable object by setting a value for theprojectGroupNameattribute.MinConfigurationwithProjectModules(java.lang.Iterable<java.lang.String> elements)Copy the current immutable object with elements that replace the content ofprojectModules.MinConfigurationwithProjectModules(java.lang.String... elements)Copy the current immutable object with elements that replace the content ofprojectModules.MinConfigurationwithProjectName(java.lang.String value)Copy the current immutable object by setting a value for theprojectNameattribute.MinConfigurationwithRelease(java.lang.String value)Copy the current immutable object by setting a value for thereleaseattribute.MinConfigurationwithSources(MinSourcesConfiguration value)Copy the current immutable object by setting a present value for the optionalsourcesattribute.MinConfigurationwithSources(java.util.Optional<? extends MinSourcesConfiguration> optional)Copy the current immutable object by setting an optional value for thesourcesattribute.
-
Method Details
-
projectName
public java.lang.String projectName()- Specified by:
projectNamein interfaceMinConfigurationType- Returns:
- The name of the project
-
projectGroupName
public java.lang.String projectGroupName()- Specified by:
projectGroupNamein interfaceMinConfigurationType- Returns:
- The group name of the project
-
projectModules
public java.util.List<java.lang.String> projectModules()- Specified by:
projectModulesin interfaceMinConfigurationType- Returns:
- The project modules
-
release
public java.lang.String release()- Specified by:
releasein interfaceMinConfigurationType- Returns:
- The version number of the current release
-
centralReposPath
public java.lang.String centralReposPath()- Specified by:
centralReposPathin interfaceMinConfigurationType- Returns:
- The path to the project within the Central Repository
-
header
public java.util.Optional<java.nio.file.Path> header()- Specified by:
headerin interfaceMinConfigurationType- Returns:
- An XHTML file containing a header inserted above the title and logo in generated sites.
-
overview
public java.util.Optional<java.nio.file.Path> overview()- Specified by:
overviewin interfaceMinConfigurationType- Returns:
- An XHTML file containing an overview of the project
-
features
public java.util.Optional<java.nio.file.Path> features()- Specified by:
featuresin interfaceMinConfigurationType- Returns:
- An XHTML file containing the features of the project
-
documentation
public java.util.Optional<java.nio.file.Path> documentation()- Specified by:
documentationin interfaceMinConfigurationType- Returns:
- An XHTML file containing the documentation links of the project
-
changelog
- Specified by:
changelogin interfaceMinConfigurationType- Returns:
- The changelog configuration, if any
-
license
public java.util.Optional<java.nio.file.Path> license()- Specified by:
licensein interfaceMinConfigurationType- Returns:
- A plain text file containing the project license
-
bugTracker
- Specified by:
bugTrackerin interfaceMinConfigurationType- Returns:
- The bug tracker configuration, if any
-
sources
- Specified by:
sourcesin interfaceMinConfigurationType- Returns:
- The project source configuration, if any
-
cssIncludes
public java.util.List<java.lang.String> cssIncludes()- Specified by:
cssIncludesin interfaceMinConfigurationType- Returns:
- The list of stylesheets that will be included by the generated site
-
cssGenerateStyle
public boolean cssGenerateStyle()- Specified by:
cssGenerateStylein interfaceMinConfigurationType- Returns:
trueif the default style should be copied to the generated site directory
-
withProjectName
Copy the current immutable object by setting a value for theprojectNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for projectName- Returns:
- A modified copy of the
thisobject
-
withProjectGroupName
Copy the current immutable object by setting a value for theprojectGroupNameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for projectGroupName- Returns:
- A modified copy of the
thisobject
-
withProjectModules
Copy the current immutable object with elements that replace the content ofprojectModules.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withProjectModules
Copy the current immutable object with elements that replace the content ofprojectModules. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of projectModules elements to set- Returns:
- A modified copy of
thisobject
-
withRelease
Copy the current immutable object by setting a value for thereleaseattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for release- Returns:
- A modified copy of the
thisobject
-
withCentralReposPath
Copy the current immutable object by setting a value for thecentralReposPathattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for centralReposPath- Returns:
- A modified copy of the
thisobject
-
withHeader
Copy the current immutable object by setting a present value for the optionalheaderattribute.- Parameters:
value- The value for header- Returns:
- A modified copy of
thisobject
-
withHeader
public final MinConfiguration withHeader(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for theheaderattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for header- Returns:
- A modified copy of
thisobject
-
withOverview
Copy the current immutable object by setting a present value for the optionaloverviewattribute.- Parameters:
value- The value for overview- Returns:
- A modified copy of
thisobject
-
withOverview
public final MinConfiguration withOverview(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for theoverviewattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for overview- Returns:
- A modified copy of
thisobject
-
withFeatures
Copy the current immutable object by setting a present value for the optionalfeaturesattribute.- Parameters:
value- The value for features- Returns:
- A modified copy of
thisobject
-
withFeatures
public final MinConfiguration withFeatures(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thefeaturesattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for features- Returns:
- A modified copy of
thisobject
-
withDocumentation
Copy the current immutable object by setting a present value for the optionaldocumentationattribute.- Parameters:
value- The value for documentation- Returns:
- A modified copy of
thisobject
-
withDocumentation
public final MinConfiguration withDocumentation(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thedocumentationattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for documentation- Returns:
- A modified copy of
thisobject
-
withChangelog
Copy the current immutable object by setting a present value for the optionalchangelogattribute.- Parameters:
value- The value for changelog- Returns:
- A modified copy of
thisobject
-
withChangelog
public final MinConfiguration withChangelog(java.util.Optional<? extends MinChangesConfiguration> optional)Copy the current immutable object by setting an optional value for thechangelogattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for changelog- Returns:
- A modified copy of
thisobject
-
withLicense
Copy the current immutable object by setting a present value for the optionallicenseattribute.- Parameters:
value- The value for license- Returns:
- A modified copy of
thisobject
-
withLicense
public final MinConfiguration withLicense(java.util.Optional<? extends java.nio.file.Path> optional)Copy the current immutable object by setting an optional value for thelicenseattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for license- Returns:
- A modified copy of
thisobject
-
withBugTracker
Copy the current immutable object by setting a present value for the optionalbugTrackerattribute.- Parameters:
value- The value for bugTracker- Returns:
- A modified copy of
thisobject
-
withBugTracker
public final MinConfiguration withBugTracker(java.util.Optional<? extends MinBugTrackerConfiguration> optional)Copy the current immutable object by setting an optional value for thebugTrackerattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for bugTracker- Returns:
- A modified copy of
thisobject
-
withSources
Copy the current immutable object by setting a present value for the optionalsourcesattribute.- Parameters:
value- The value for sources- Returns:
- A modified copy of
thisobject
-
withSources
public final MinConfiguration withSources(java.util.Optional<? extends MinSourcesConfiguration> optional)Copy the current immutable object by setting an optional value for thesourcesattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for sources- Returns:
- A modified copy of
thisobject
-
withCssIncludes
Copy the current immutable object with elements that replace the content ofcssIncludes.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withCssIncludes
Copy the current immutable object with elements that replace the content ofcssIncludes. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of cssIncludes elements to set- Returns:
- A modified copy of
thisobject
-
withCssGenerateStyle
Copy the current immutable object by setting a value for thecssGenerateStyleattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for cssGenerateStyle- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofMinConfigurationthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
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:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueMinConfigurationwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
of
public static MinConfiguration of(java.lang.String projectName, java.lang.String projectGroupName, java.util.List<java.lang.String> projectModules, java.lang.String release, java.lang.String centralReposPath, java.util.Optional<java.nio.file.Path> header, java.util.Optional<java.nio.file.Path> overview, java.util.Optional<java.nio.file.Path> features, java.util.Optional<java.nio.file.Path> documentation, java.util.Optional<MinChangesConfiguration> changelog, java.util.Optional<java.nio.file.Path> license, java.util.Optional<MinBugTrackerConfiguration> bugTracker, java.util.Optional<MinSourcesConfiguration> sources, java.util.List<java.lang.String> cssIncludes, boolean cssGenerateStyle)Construct a new immutableMinConfigurationinstance.- Parameters:
projectName- The value for theprojectNameattributeprojectGroupName- The value for theprojectGroupNameattributeprojectModules- The value for theprojectModulesattributerelease- The value for thereleaseattributecentralReposPath- The value for thecentralReposPathattributeheader- The value for theheaderattributeoverview- The value for theoverviewattributefeatures- The value for thefeaturesattributedocumentation- The value for thedocumentationattributechangelog- The value for thechangelogattributelicense- The value for thelicenseattributebugTracker- The value for thebugTrackerattributesources- The value for thesourcesattributecssIncludes- The value for thecssIncludesattributecssGenerateStyle- The value for thecssGenerateStyleattribute- Returns:
- An immutable MinConfiguration instance
-
of
public static MinConfiguration of(java.lang.String projectName, java.lang.String projectGroupName, java.lang.Iterable<java.lang.String> projectModules, java.lang.String release, java.lang.String centralReposPath, java.util.Optional<? extends java.nio.file.Path> header, java.util.Optional<? extends java.nio.file.Path> overview, java.util.Optional<? extends java.nio.file.Path> features, java.util.Optional<? extends java.nio.file.Path> documentation, java.util.Optional<? extends MinChangesConfiguration> changelog, java.util.Optional<? extends java.nio.file.Path> license, java.util.Optional<? extends MinBugTrackerConfiguration> bugTracker, java.util.Optional<? extends MinSourcesConfiguration> sources, java.lang.Iterable<java.lang.String> cssIncludes, boolean cssGenerateStyle)Construct a new immutableMinConfigurationinstance.- Parameters:
projectName- The value for theprojectNameattributeprojectGroupName- The value for theprojectGroupNameattributeprojectModules- The value for theprojectModulesattributerelease- The value for thereleaseattributecentralReposPath- The value for thecentralReposPathattributeheader- The value for theheaderattributeoverview- The value for theoverviewattributefeatures- The value for thefeaturesattributedocumentation- The value for thedocumentationattributechangelog- The value for thechangelogattributelicense- The value for thelicenseattributebugTracker- The value for thebugTrackerattributesources- The value for thesourcesattributecssIncludes- The value for thecssIncludesattributecssGenerateStyle- The value for thecssGenerateStyleattribute- Returns:
- An immutable MinConfiguration instance
-
copyOf
Creates an immutable copy of aMinConfigurationTypevalue. 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
Creates a builder forMinConfiguration.MinConfiguration.builder() .setProjectName(String) // requiredprojectName.setProjectGroupName(String) // requiredprojectGroupName.addProjectModules|addAllProjectModules(String) //projectModuleselements .setRelease(String) // requiredrelease.setCentralReposPath(String) // requiredcentralReposPath.setHeader(java.nio.file.Path) // optionalheader.setOverview(java.nio.file.Path) // optionaloverview.setFeatures(java.nio.file.Path) // optionalfeatures.setDocumentation(java.nio.file.Path) // optionaldocumentation.setChangelog(MinChangesConfiguration) // optionalchangelog.setLicense(java.nio.file.Path) // optionallicense.setBugTracker(MinBugTrackerConfiguration) // optionalbugTracker.setSources(MinSourcesConfiguration) // optionalsources.addCssIncludes|addAllCssIncludes(String) //cssIncludeselements .setCssGenerateStyle(boolean) // optionalcssGenerateStyle.build();- Returns:
- A new MinConfiguration builder
-