Class SimpleConfigurationLayer
- java.lang.Object
-
- com.mooltiverse.oss.nyx.configuration.SimpleConfigurationLayer
-
- All Implemented Interfaces:
ConfigurationLayer,ConfigurationRoot
public class SimpleConfigurationLayer extends Object implements ConfigurationLayer
A simple configuration layer, acting as a value holder for configuration options. This object allows read/write operations.
-
-
Constructor Summary
Constructors Constructor Description SimpleConfigurationLayer()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBump()Returns the version identifier to bump as it's defined by this configuration.ChangelogConfigurationgetChangelog()Returns the changelog configuration section.CommitMessageConventionsgetCommitMessageConventions()Returns the commit message convention configuration section.StringgetConfigurationFile()Returns the path to a custom configuration file as it's defined by this configuration.StringgetDirectory()Returns the directory to use as the working directory as it's defined by this configuration.BooleangetDryRun()Returns the value of the dry run flag as it's defined by this configuration.GitConfigurationgetGit()Returns the Git configuration section.StringgetInitialVersion()Returns the initial version defined by this configuration to use when no past version is available in the commit history.StringgetPreset()Returns selected preset configuration as it's defined by this configuration.Map<String,Attachment>getReleaseAssets()Returns the release assets configuration section.BooleangetReleaseLenient()Returns the flag that enables tolerance in reading release names with arbitrary prefixes or extra non critical characters as it's defined by this configuration.StringgetReleasePrefix()Returns the prefix to use in release name generation as it's defined by this configuration.ReleaseTypesgetReleaseTypes()Returns the release types configuration section.BooleangetResume()Returns the value of the resume flag as it's defined by this configuration.SchemegetScheme()Returns the versioning scheme to use as it's defined by this configuration.Map<String,ServiceConfiguration>getServices()Returns the services configuration section.StringgetSharedConfigurationFile()Returns the path to a custom shared configuration file as it's defined by this configuration.StringgetStateFile()Returns the path to the file where the NyxStatemust be saved as it's defined by this configuration.VerbositygetVerbosity()Returns the logging verbosity level as it's defined by this configuration.StringgetVersion()Returns the version defined by this configuration.voidsetBump(String bump)Sets the value for this option.voidsetChangelog(ChangelogConfiguration changelog)Sets the value for this option.voidsetCommitMessageConventions(CommitMessageConventions commitMessageConventions)Sets the value for this option.voidsetConfigurationFile(String configurationFile)Sets the value for this option.voidsetDirectory(String directory)Sets the value for this option.voidsetDryRun(Boolean dryRun)Sets the value for this option.voidsetGit(GitConfiguration git)Sets the value for this option.voidsetInitialVersion(String initialVersion)Sets the value for this option.voidsetPreset(String preset)Sets the value for this option.voidsetReleaseAssets(Map<String,Attachment> releaseAssets)Sets the value for this option.voidsetReleaseLenient(Boolean releaseLenient)Sets the value for this option.voidsetReleasePrefix(String releasePrefix)Sets the value for this option.voidsetReleaseTypes(ReleaseTypes releaseTypes)Sets the value for this option.voidsetResume(Boolean resume)Sets the value for this option.voidsetScheme(Scheme scheme)Sets the value for this option.voidsetServices(Map<String,ServiceConfiguration> services)Sets the value for this option.voidsetSharedConfigurationFile(String sharedConfigurationFile)Sets the value for this option.voidsetStateFile(String stateFile)Sets the value for this option.voidsetVerbosity(Verbosity verbosity)Sets the value for this option.voidsetVersion(String version)Sets the value for this option.
-
-
-
Method Detail
-
getBump
public String getBump()
Returns the version identifier to bump as it's defined by this configuration.- Specified by:
getBumpin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setBump
public void setBump(String bump)
Sets the value for this option.- Parameters:
bump- the value for this option.
-
getChangelog
public ChangelogConfiguration getChangelog()
Returns the changelog configuration section.- Specified by:
getChangelogin interfaceConfigurationRoot- Returns:
- the changelog configuration section. Never
null.
-
setChangelog
public void setChangelog(ChangelogConfiguration changelog)
Sets the value for this option.- Parameters:
changelog- the value for this option.
-
getCommitMessageConventions
public CommitMessageConventions getCommitMessageConventions()
Returns the commit message convention configuration section.- Specified by:
getCommitMessageConventionsin interfaceConfigurationRoot- Returns:
- the commit message convention configuration section. Never
null.
-
setCommitMessageConventions
public void setCommitMessageConventions(CommitMessageConventions commitMessageConventions)
Sets the value for this option.- Parameters:
commitMessageConventions- the value for this option.
-
getConfigurationFile
public String getConfigurationFile()
Returns the path to a custom configuration file as it's defined by this configuration.- Specified by:
getConfigurationFilein interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setConfigurationFile
public void setConfigurationFile(String configurationFile)
Sets the value for this option.- Parameters:
configurationFile- the value for this option.
-
getDirectory
public String getDirectory()
Returns the directory to use as the working directory as it's defined by this configuration.- Specified by:
getDirectoryin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined. - See Also:
State.getDirectory()
-
setDirectory
public void setDirectory(String directory)
Sets the value for this option.- Parameters:
directory- the value for this option.
-
getDryRun
public Boolean getDryRun()
Returns the value of the dry run flag as it's defined by this configuration.- Specified by:
getDryRunin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setDryRun
public void setDryRun(Boolean dryRun)
Sets the value for this option.- Parameters:
dryRun- the value for this option.
-
getGit
public GitConfiguration getGit()
Returns the Git configuration section.- Specified by:
getGitin interfaceConfigurationRoot- Returns:
- the Git configuration section. Never
null.
-
setGit
public void setGit(GitConfiguration git)
Sets the value for this option.- Parameters:
git- the value for this option.
-
getInitialVersion
public String getInitialVersion()
Returns the initial version defined by this configuration to use when no past version is available in the commit history.- Specified by:
getInitialVersionin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setInitialVersion
public void setInitialVersion(String initialVersion)
Sets the value for this option.- Parameters:
initialVersion- the value for this option.
-
getPreset
public String getPreset()
Returns selected preset configuration as it's defined by this configuration.- Specified by:
getPresetin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setPreset
public void setPreset(String preset)
Sets the value for this option.- Parameters:
preset- the value for this option.
-
getReleaseAssets
public Map<String,Attachment> getReleaseAssets()
Returns the release assets configuration section.- Specified by:
getReleaseAssetsin interfaceConfigurationRoot- Returns:
- the release assets configuration section. Never
null.
-
setReleaseAssets
public void setReleaseAssets(Map<String,Attachment> releaseAssets)
Sets the value for this option.- Parameters:
releaseAssets- the value for this option.
-
getReleaseLenient
public Boolean getReleaseLenient()
Returns the flag that enables tolerance in reading release names with arbitrary prefixes or extra non critical characters as it's defined by this configuration.- Specified by:
getReleaseLenientin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setReleaseLenient
public void setReleaseLenient(Boolean releaseLenient)
Sets the value for this option.- Parameters:
releaseLenient- the value for this option.
-
getReleasePrefix
public String getReleasePrefix()
Returns the prefix to use in release name generation as it's defined by this configuration.- Specified by:
getReleasePrefixin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setReleasePrefix
public void setReleasePrefix(String releasePrefix)
Sets the value for this option.- Parameters:
releasePrefix- the value for this option.
-
getReleaseTypes
public ReleaseTypes getReleaseTypes()
Returns the release types configuration section.- Specified by:
getReleaseTypesin interfaceConfigurationRoot- Returns:
- the release types configuration section. Never
null.
-
setReleaseTypes
public void setReleaseTypes(ReleaseTypes releaseTypes)
Sets the value for this option.- Parameters:
releaseTypes- the value for this option.
-
getResume
public Boolean getResume()
Returns the value of the resume flag as it's defined by this configuration.- Specified by:
getResumein interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setResume
public void setResume(Boolean resume)
Sets the value for this option.- Parameters:
resume- the value for this option.
-
getScheme
public Scheme getScheme()
Returns the versioning scheme to use as it's defined by this configuration.- Specified by:
getSchemein interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setScheme
public void setScheme(Scheme scheme)
Sets the value for this option.- Parameters:
scheme- the value for this option.
-
getServices
public Map<String,ServiceConfiguration> getServices()
Returns the services configuration section.- Specified by:
getServicesin interfaceConfigurationRoot- Returns:
- the services configuration section. Never
null.
-
setServices
public void setServices(Map<String,ServiceConfiguration> services)
Sets the value for this option.- Parameters:
services- the value for this option.
-
getSharedConfigurationFile
public String getSharedConfigurationFile()
Returns the path to a custom shared configuration file as it's defined by this configuration.- Specified by:
getSharedConfigurationFilein interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setSharedConfigurationFile
public void setSharedConfigurationFile(String sharedConfigurationFile)
Sets the value for this option.- Parameters:
sharedConfigurationFile- the value for this option.
-
getStateFile
public String getStateFile()
Returns the path to the file where the NyxStatemust be saved as it's defined by this configuration.- Specified by:
getStateFilein interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setStateFile
public void setStateFile(String stateFile)
Sets the value for this option.- Parameters:
stateFile- the value for this option.
-
getVerbosity
public Verbosity getVerbosity()
Returns the logging verbosity level as it's defined by this configuration. Please note that the verbosity option is actually ignored in this library implementation as the event filtering based on the verbosity needs to be configured outside this library, depending on the logging framework deployed along with SLF4J. See here for more.- Specified by:
getVerbosityin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setVerbosity
public void setVerbosity(Verbosity verbosity)
Sets the value for this option.- Parameters:
verbosity- the value for this option.
-
getVersion
public String getVersion()
Returns the version defined by this configuration.- Specified by:
getVersionin interfaceConfigurationRoot- Returns:
- the configured value for this option or
nullif the value hasn't been defined.
-
setVersion
public void setVersion(String version)
Sets the value for this option.- Parameters:
version- the value for this option.
-
-