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.protectedCreate 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 ornullto use the root directory.Return theBuildSystemto use.Return theConfigurationFileFormatof the project.Return a human-readable description of the project.Return the buildgroupId.Return the primaryLanguageof the project.getName()Return a simple name for the project.Return the root package name of the project.Return the buildPackagingto use.Return the requested platformVersion.Return an immutable mapping of requesteddependencies.Return the version of the project.Removes the dependency with the given id.voidsetApplicationName(String applicationName) Sets the application name.voidsetArtifactId(String artifactId) Sets the artifact id.voidsetBaseDirectory(String baseDirectory) Sets the base directory.voidsetBuildSystem(BuildSystem buildSystem) Sets the build system.voidsetConfigurationFileFormat(ConfigurationFileFormat configurationFileFormat) Sets the configuration file format.voidsetDescription(String description) Sets the description.voidsetGroupId(String groupId) Sets the group id.voidsetLanguage(Language language) Sets the language.voidSets the name.voidsetPackageName(String packageName) Sets the package name.voidsetPackaging(Packaging packaging) Sets the packaging.voidsetPlatformVersion(Version platformVersion) Sets the platform version.voidsetVersion(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:ProjectDescriptionCreate a full copy of this description so that any additional changes made on this instance are not reflected on the returned copy.- Specified by:
createCopyin interfaceProjectDescription- Returns:
- a clone of this instance
-
getPlatformVersion
Description copied from interface:ProjectDescriptionReturn the requested platformVersion.- Specified by:
getPlatformVersionin interfaceProjectDescription- Returns:
- the requested platform version or
null
-
setPlatformVersion
Sets the platform version.- Parameters:
platformVersion- the platform version
-
getBuildSystem
Description copied from interface:ProjectDescriptionReturn theBuildSystemto use.- Specified by:
getBuildSystemin interfaceProjectDescription- Returns:
- the build system or
null
-
setBuildSystem
Sets the build system.- Parameters:
buildSystem- the build system
-
getPackaging
Description copied from interface:ProjectDescriptionReturn the buildPackagingto use.- Specified by:
getPackagingin interfaceProjectDescription- Returns:
- the build packaging or
null
-
setPackaging
Sets the packaging.- Parameters:
packaging- the packaging
-
getLanguage
Description copied from interface:ProjectDescriptionReturn the primaryLanguageof the project.- Specified by:
getLanguagein interfaceProjectDescription- Returns:
- the primary language or
null
-
setConfigurationFileFormat
Sets the configuration file format.- Parameters:
configurationFileFormat- the configuration file format
-
getConfigurationFileFormat
Description copied from interface:ProjectDescriptionReturn theConfigurationFileFormatof the project.- Specified by:
getConfigurationFileFormatin 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:ProjectDescriptionReturn an immutable mapping of requesteddependencies.- Specified by:
getRequestedDependenciesin interfaceProjectDescription- Returns:
- the requested dependencies
-
getGroupId
Description copied from interface:ProjectDescriptionReturn the buildgroupId.- Specified by:
getGroupIdin interfaceProjectDescription- Returns:
- the groupId or
null
-
setGroupId
Sets the group id.- Parameters:
groupId- the group id
-
getArtifactId
Description copied from interface:ProjectDescriptionReturn the buildartifactId.- Specified by:
getArtifactIdin interfaceProjectDescription- Returns:
- the artifactId or
null
-
setArtifactId
Sets the artifact id.- Parameters:
artifactId- the artifact id
-
getVersion
Description copied from interface:ProjectDescriptionReturn the version of the project.- Specified by:
getVersionin interfaceProjectDescription- Returns:
- the version of
null
-
setVersion
Sets the version.- Parameters:
version- the version
-
getName
Description copied from interface:ProjectDescriptionReturn a simple name for the project.- Specified by:
getNamein interfaceProjectDescription- Returns:
- the name of the project or
null
-
setName
Sets the name.- Parameters:
name- the name
-
getDescription
Description copied from interface:ProjectDescriptionReturn a human-readable description of the project.- Specified by:
getDescriptionin interfaceProjectDescription- Returns:
- the description of the project or
null
-
setDescription
Sets the description.- Parameters:
description- the description
-
getApplicationName
Description copied from interface:ProjectDescriptionReturn the name of the application as a standard Java identifier.- Specified by:
getApplicationNamein interfaceProjectDescription- Returns:
- the name of the application or
null
-
setApplicationName
Sets the application name.- Parameters:
applicationName- the application name
-
getPackageName
Description copied from interface:ProjectDescriptionReturn the root package name of the project.- Specified by:
getPackageNamein interfaceProjectDescription- Returns:
- the package name or
null
-
setPackageName
Sets the package name.- Parameters:
packageName- the package name
-
getBaseDirectory
Description copied from interface:ProjectDescriptionReturn the base directory of the project ornullto use the root directory.- Specified by:
getBaseDirectoryin interfaceProjectDescription- Returns:
- the base directory
-
setBaseDirectory
Sets the base directory.- Parameters:
baseDirectory- the base directory
-