Class MutableProjectDescription
java.lang.Object
io.spring.initializr.generator.project.MutableProjectDescription
- All Implemented Interfaces:
ProjectDescription
A mutable implementation of
ProjectDescription
.- Author:
- Andy Wilkinson
-
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new instance.protected
Create a new instance with the state of the specifiedsource
. -
Method Summary
Modifier and TypeMethodDescriptionaddDependency
(String id, Dependency dependency) Adds the given dependency.addDependency
(String id, Dependency.Builder<?> builder) Adds the given dependency.Create a full copy of this description so that any additional changes made on this instance are not reflected on the returned copy.Return the name of the application as a standard Java identifier.Return the buildartifactId
.Return the base directory of the project ornull
to use the root directory.Return theBuildSystem
to use.Return theConfigurationFileFormat
of the project.Return a human-readable description of the project.Return the buildgroupId
.Return the primaryLanguage
of the project.getName()
Return a simple name for the project.Return the root package name of the project.Return the buildPackaging
to use.Return the requested platformVersion
.Return an immutable mapping of requesteddependencies
.Return the version of the project.Removes the dependency with the given id.void
setApplicationName
(String applicationName) Sets the application name.void
setArtifactId
(String artifactId) Sets the artifact id.void
setBaseDirectory
(String baseDirectory) Sets the base directory.void
setBuildSystem
(BuildSystem buildSystem) Sets the build system.void
setConfigurationFileFormat
(ConfigurationFileFormat configurationFileFormat) Sets the configuration file format.void
setDescription
(String description) Sets the description.void
setGroupId
(String groupId) Sets the group id.void
setLanguage
(Language language) Sets the language.void
Sets the name.void
setPackageName
(String packageName) Sets the package name.void
setPackaging
(Packaging packaging) Sets the packaging.void
setPlatformVersion
(Version platformVersion) Sets the platform version.void
setVersion
(String version) Sets the version.
-
Constructor Details
-
MutableProjectDescription
public MutableProjectDescription()Creates a new instance. -
MutableProjectDescription
Create a new instance with the state of the specifiedsource
.- Parameters:
source
- the source description to initialize this instance with
-
-
Method Details
-
createCopy
Description copied from interface:ProjectDescription
Create a full copy of this description so that any additional changes made on this instance are not reflected on the returned copy.- Specified by:
createCopy
in interfaceProjectDescription
- Returns:
- a clone of this instance
-
getPlatformVersion
Description copied from interface:ProjectDescription
Return the requested platformVersion
.- Specified by:
getPlatformVersion
in interfaceProjectDescription
- Returns:
- the requested platform version or
null
-
setPlatformVersion
Sets the platform version.- Parameters:
platformVersion
- the platform version
-
getBuildSystem
Description copied from interface:ProjectDescription
Return theBuildSystem
to use.- Specified by:
getBuildSystem
in interfaceProjectDescription
- Returns:
- the build system or
null
-
setBuildSystem
Sets the build system.- Parameters:
buildSystem
- the build system
-
getPackaging
Description copied from interface:ProjectDescription
Return the buildPackaging
to use.- Specified by:
getPackaging
in interfaceProjectDescription
- Returns:
- the build packaging or
null
-
setPackaging
Sets the packaging.- Parameters:
packaging
- the packaging
-
getLanguage
Description copied from interface:ProjectDescription
Return the primaryLanguage
of the project.- Specified by:
getLanguage
in interfaceProjectDescription
- Returns:
- the primary language or
null
-
setConfigurationFileFormat
Sets the configuration file format.- Parameters:
configurationFileFormat
- the configuration file format
-
getConfigurationFileFormat
Description copied from interface:ProjectDescription
Return theConfigurationFileFormat
of the project.- Specified by:
getConfigurationFileFormat
in interfaceProjectDescription
- Returns:
- the configuration file format or
null
-
setLanguage
Sets the language.- Parameters:
language
- the language
-
addDependency
Adds the given dependency.- Parameters:
id
- the iddependency
- the dependency- Returns:
- the added dependency
-
addDependency
Adds the given dependency.- Parameters:
id
- the idbuilder
- the dependency builder- Returns:
- the added dependency
-
removeDependency
Removes the dependency with the given id.- Parameters:
id
- the id- Returns:
- the removed dependency
-
getRequestedDependencies
Description copied from interface:ProjectDescription
Return an immutable mapping of requesteddependencies
.- Specified by:
getRequestedDependencies
in interfaceProjectDescription
- Returns:
- the requested dependencies
-
getGroupId
Description copied from interface:ProjectDescription
Return the buildgroupId
.- Specified by:
getGroupId
in interfaceProjectDescription
- Returns:
- the groupId or
null
-
setGroupId
Sets the group id.- Parameters:
groupId
- the group id
-
getArtifactId
Description copied from interface:ProjectDescription
Return the buildartifactId
.- Specified by:
getArtifactId
in interfaceProjectDescription
- Returns:
- the artifactId or
null
-
setArtifactId
Sets the artifact id.- Parameters:
artifactId
- the artifact id
-
getVersion
Description copied from interface:ProjectDescription
Return the version of the project.- Specified by:
getVersion
in interfaceProjectDescription
- Returns:
- the version of
null
-
setVersion
Sets the version.- Parameters:
version
- the version
-
getName
Description copied from interface:ProjectDescription
Return a simple name for the project.- Specified by:
getName
in interfaceProjectDescription
- Returns:
- the name of the project or
null
-
setName
Sets the name.- Parameters:
name
- the name
-
getDescription
Description copied from interface:ProjectDescription
Return a human-readable description of the project.- Specified by:
getDescription
in interfaceProjectDescription
- Returns:
- the description of the project or
null
-
setDescription
Sets the description.- Parameters:
description
- the description
-
getApplicationName
Description copied from interface:ProjectDescription
Return the name of the application as a standard Java identifier.- Specified by:
getApplicationName
in interfaceProjectDescription
- Returns:
- the name of the application or
null
-
setApplicationName
Sets the application name.- Parameters:
applicationName
- the application name
-
getPackageName
Description copied from interface:ProjectDescription
Return the root package name of the project.- Specified by:
getPackageName
in interfaceProjectDescription
- Returns:
- the package name or
null
-
setPackageName
Sets the package name.- Parameters:
packageName
- the package name
-
getBaseDirectory
Description copied from interface:ProjectDescription
Return the base directory of the project ornull
to use the root directory.- Specified by:
getBaseDirectory
in interfaceProjectDescription
- Returns:
- the base directory
-
setBaseDirectory
Sets the base directory.- Parameters:
baseDirectory
- the base directory
-