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 TypeMethodDescription@Nullable DependencyaddDependency(String id, Dependency dependency) Adds the given dependency.@Nullable DependencyaddDependency(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.@Nullable StringReturn the name of the application as a standard Java identifier.@Nullable StringReturn the buildartifactId.@Nullable StringReturn the base directory of the project ornullto use the root directory.@Nullable BuildSystemReturn theBuildSystemto use.Return the changes that have been applied to this description, so that aProjectDescriptionCustomizercan record the reason why it changed a field.@Nullable ConfigurationFileFormatReturn theConfigurationFileFormatof the project.@Nullable StringReturn a human-readable description of the project.@Nullable StringReturn the buildgroupId.@Nullable LanguageReturn the primaryLanguageof the project.@Nullable StringgetName()Return a simple name for the project.@Nullable StringReturn the root package name of the project.@Nullable PackagingReturn the buildPackagingto use.@Nullable VersionReturn the requested platformVersion.Return an immutable mapping of requesteddependencies.@Nullable StringReturn the version of the project.@Nullable DependencyRemoves the dependency with the given id.voidsetApplicationName(@Nullable String applicationName) Sets the application name.voidsetArtifactId(@Nullable String artifactId) Sets the artifact id.voidsetBaseDirectory(@Nullable String baseDirectory) Sets the base directory.voidsetBuildSystem(@Nullable BuildSystem buildSystem) Sets the build system.voidsetConfigurationFileFormat(@Nullable ConfigurationFileFormat configurationFileFormat) Sets the configuration file format.voidsetDescription(@Nullable String description) Sets the description.voidsetGroupId(@Nullable String groupId) Sets the group id.voidsetLanguage(@Nullable Language language) Sets the language.voidSets the name.voidsetPackageName(@Nullable String packageName) Sets the package name.voidsetPackaging(@Nullable Packaging packaging) Sets the packaging.voidsetPlatformVersion(@Nullable Version platformVersion) Sets the platform version.voidsetVersion(@Nullable 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
-
getChanges
Return the changes that have been applied to this description, so that aProjectDescriptionCustomizercan record the reason why it changed a field.- Returns:
- the changes
-
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
-
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
-