Skip to content

Commit d032e88

Browse files
committed
Start adding missing JavaDoc
See gh-1600
1 parent e645e5c commit d032e88

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+643
-8
lines changed

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/MavenRepository.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ public class MavenRepository {
4545

4646
private final boolean snapshotsEnabled;
4747

48+
/**
49+
* Creates a new instance.
50+
* @param builder the builder to use
51+
*/
4852
protected MavenRepository(Builder builder) {
4953
this.id = builder.id;
5054
this.name = builder.name;
@@ -123,6 +127,9 @@ public int hashCode() {
123127
return Objects.hash(this.id, this.name, this.url, this.releasesEnabled, this.snapshotsEnabled);
124128
}
125129

130+
/**
131+
* Builder for {@link MavenRepository}.
132+
*/
126133
public static class Builder {
127134

128135
private String id;
@@ -135,6 +142,11 @@ public static class Builder {
135142

136143
private boolean snapshotsEnabled;
137144

145+
/**
146+
* Creates a new instance.
147+
* @param id the id
148+
* @param url the url
149+
*/
138150
public Builder(String id, String url) {
139151
this.id = id;
140152
this.name = id;

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/gradle/GradleExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public Set<String> getImportedTypes() {
112112
}
113113

114114
/**
115-
* A builder for {@link GradleExtension}.
115+
* Builder for {@link GradleExtension}.
116116
*/
117117
public static class Builder {
118118

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/gradle/GradleTask.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Map<String, GradleTask> getNested() {
9797
}
9898

9999
/**
100-
* A builder for {@link GradleTask}.
100+
* Builder for {@link GradleTask}.
101101
*/
102102
public static class Builder {
103103

@@ -111,6 +111,11 @@ public static class Builder {
111111

112112
private final Map<String, Builder> nested = new LinkedHashMap<>();
113113

114+
/**
115+
* Creates a new instance.
116+
* @param name the name of the task
117+
* @param type the type of the task
118+
*/
114119
protected Builder(String name, String type) {
115120
this.name = name;
116121
this.type = type;

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/gradle/GroovyDslGradleBuildWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ protected void writeConfigurations(IndentingWriter writer, GradleConfigurationCo
119119
writer.println("");
120120
}
121121

122+
/**
123+
* Writes the given configuration.
124+
* @param writer the writer to write to
125+
* @param configuration the configuration to write
126+
*/
122127
protected void writeConfiguration(IndentingWriter writer, GradleConfiguration configuration) {
123128
writer.println(configuration.getName() + " {");
124129
writer.indented(() -> writer

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/gradle/Invocation.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public class Invocation {
3030

3131
private final List<String> arguments;
3232

33+
/**
34+
* Creates a new instance.
35+
* @param target the target
36+
* @param arguments the arguments
37+
*/
3338
public Invocation(String target, List<String> arguments) {
3439
this.target = target;
3540
this.arguments = List.copyOf(arguments);

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenBuild.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,18 @@ public class MavenBuild extends Build {
4747

4848
private final MavenProfileContainer profiles;
4949

50+
/**
51+
* Creates a new instance.
52+
* @param buildItemResolver the build item resolver
53+
*/
5054
public MavenBuild(BuildItemResolver buildItemResolver) {
5155
super(buildItemResolver);
5256
this.profiles = new MavenProfileContainer(determineBuildItemResolver(buildItemResolver));
5357
}
5458

59+
/**
60+
* Creates a new instance.
61+
*/
5562
public MavenBuild() {
5663
this(null);
5764
}

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenBuildSettings.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ public class MavenBuildSettings extends BuildSettings {
5959

6060
private final boolean addOverrideIfEmpty;
6161

62+
/**
63+
* Creates a new instance.
64+
* @param builder the builder to use
65+
*/
6266
protected MavenBuildSettings(Builder builder) {
6367
super(builder);
6468
this.parent = builder.parent;
@@ -216,6 +220,9 @@ public static class Builder extends BuildSettings.Builder<Builder> {
216220

217221
private boolean addOverrideIfEmpty;
218222

223+
/**
224+
* Creates a new instance.
225+
*/
219226
public Builder() {
220227
}
221228

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenDependency.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@
2525
*/
2626
public class MavenDependency extends Dependency {
2727

28+
/**
29+
* Whether this dependency is optional.
30+
*/
2831
protected final boolean optional;
2932

33+
/**
34+
* Creates a new instance.
35+
* @param builder the builder to use
36+
*/
3037
protected MavenDependency(Builder builder) {
3138
super(builder);
3239
this.optional = builder.optional;
@@ -69,6 +76,11 @@ public static class Builder extends Dependency.Builder<Builder> {
6976

7077
private boolean optional;
7178

79+
/**
80+
* Creates a new instance.
81+
* @param groupId the group id
82+
* @param artifactId the artifact id
83+
*/
7284
protected Builder(String groupId, String artifactId) {
7385
super(groupId, artifactId);
7486
}

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenDeveloper.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ public Builder property(String key, String value) {
245245
return this;
246246
}
247247

248+
/**
249+
* Builds the developer.
250+
* @return the developer
251+
*/
248252
public MavenDeveloper build() {
249253
return new MavenDeveloper(this);
250254
}

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenDistributionManagement.java

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ public class MavenDistributionManagement {
4444
this.relocation = builder.relocation.build();
4545
}
4646

47+
/**
48+
* Returns whether this instance is empty.
49+
* @return whether this instance is empty
50+
*/
4751
public boolean isEmpty() {
4852
return this.downloadUrl == null && this.repository.isEmpty() && this.snapshotRepository.isEmpty()
4953
&& this.site.isEmpty() && this.relocation.isEmpty();
@@ -92,17 +96,20 @@ public Relocation getRelocation() {
9296
return this.relocation;
9397
}
9498

99+
/**
100+
* Builder for {@link MavenDistributionManagement}.
101+
*/
95102
public static class Builder {
96103

97104
private String downloadUrl;
98105

99-
private DeploymentRepository.Builder repository = new DeploymentRepository.Builder();
106+
private final DeploymentRepository.Builder repository = new DeploymentRepository.Builder();
100107

101-
private DeploymentRepository.Builder snapshotRepository = new DeploymentRepository.Builder();
108+
private final DeploymentRepository.Builder snapshotRepository = new DeploymentRepository.Builder();
102109

103-
private Site.Builder site = new Site.Builder();
110+
private final Site.Builder site = new Site.Builder();
104111

105-
private Relocation.Builder relocation = new Relocation.Builder();
112+
private final Relocation.Builder relocation = new Relocation.Builder();
106113

107114
/**
108115
* Specify the URL where this project can be downloaded from.
@@ -188,6 +195,10 @@ public static class DeploymentRepository {
188195
this.uniqueVersion = builder.uniqueVersion;
189196
}
190197

198+
/**
199+
* Returns whether this instance is empty.
200+
* @return whether this instance is empty
201+
*/
191202
public boolean isEmpty() {
192203
return this.id == null && this.name == null && this.url == null && this.layout == null
193204
&& this.uniqueVersion == null;
@@ -234,6 +245,9 @@ public Boolean getUniqueVersion() {
234245
return this.uniqueVersion;
235246
}
236247

248+
/**
249+
* Builder for {@link DeploymentRepository}.
250+
*/
237251
public static class Builder {
238252

239253
private String id;
@@ -329,6 +343,10 @@ public static class Site {
329343
this.url = builder.url;
330344
}
331345

346+
/**
347+
* Returns whether this instance is empty.
348+
* @return whether this instance is empty
349+
*/
332350
public boolean isEmpty() {
333351
return this.id == null && this.name == null && this.url == null;
334352
}
@@ -357,6 +375,9 @@ public String getUrl() {
357375
return this.url;
358376
}
359377

378+
/**
379+
* Builder for {@link Site}.
380+
*/
360381
public static class Builder {
361382

362383
private String id;
@@ -429,6 +450,10 @@ public static class Relocation {
429450
this.message = builder.message;
430451
}
431452

453+
/**
454+
* Returns whether this instance is empty.
455+
* @return whether this instance is empty
456+
*/
432457
public boolean isEmpty() {
433458
return this.groupId == null && this.artifactId == null && this.version == null && this.message == null;
434459
}
@@ -465,6 +490,9 @@ public String getMessage() {
465490
return this.message;
466491
}
467492

493+
/**
494+
* Builder for {@link Relocation}.
495+
*/
468496
public static class Builder {
469497

470498
private String groupId;

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenExtension.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public class MavenExtension {
3232

3333
private final VersionReference version;
3434

35+
/**
36+
* Creates a new instance.
37+
* @param builder the builder to use
38+
*/
3539
protected MavenExtension(Builder builder) {
3640
this.groupId = builder.groupId;
3741
this.artifactId = builder.artifactId;
@@ -72,6 +76,9 @@ public VersionReference getVersionReference() {
7276
return this.version;
7377
}
7478

79+
/**
80+
* Builder for {@link MavenExtension}.
81+
*/
7582
public static class Builder {
7683

7784
private final String groupId;
@@ -80,6 +87,11 @@ public static class Builder {
8087

8188
private VersionReference version;
8289

90+
/**
91+
* Creates a new instance.
92+
* @param groupId the group id
93+
* @param artifactId the artifact id
94+
*/
8395
protected Builder(String groupId, String artifactId) {
8496
this.groupId = groupId;
8597
this.artifactId = artifactId;

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenLicense.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ public Builder comments(String comments) {
124124
return this;
125125
}
126126

127+
/**
128+
* Builds the license.
129+
* @return the license
130+
*/
127131
public MavenLicense build() {
128132
return new MavenLicense(this);
129133
}

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenPlugin.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ public class MavenPlugin {
5050

5151
private final Configuration configuration;
5252

53+
/**
54+
* Creates a new instance.
55+
* @param builder the builder to use
56+
*/
5357
protected MavenPlugin(Builder builder) {
5458
this.groupId = builder.groupId;
5559
this.artifactId = builder.artifactId;
@@ -158,6 +162,11 @@ public static class Builder {
158162

159163
private ConfigurationBuilder configurationBuilder;
160164

165+
/**
166+
* Creates a new instance.
167+
* @param groupId the group id
168+
* @param artifactId the artifact id
169+
*/
161170
protected Builder(String groupId, String artifactId) {
162171
this.groupId = groupId;
163172
this.artifactId = artifactId;
@@ -279,6 +288,10 @@ public static class ExecutionBuilder {
279288

280289
private ConfigurationBuilder configurationCustomization = null;
281290

291+
/**
292+
* Creates a new instance.
293+
* @param id the id
294+
*/
282295
public ExecutionBuilder(String id) {
283296
this.id = id;
284297
}

initializr-generator/src/main/java/io/spring/initializr/generator/buildsystem/maven/MavenProfile.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public class MavenProfile {
5757

5858
private final MavenDistributionManagement.Builder distributionManagement = new MavenDistributionManagement.Builder();
5959

60+
/**
61+
* Creates a new instance.
62+
* @param id the id
63+
* @param buildItemResolver the build item resolver
64+
*/
6065
protected MavenProfile(String id, BuildItemResolver buildItemResolver) {
6166
this.id = id;
6267
this.dependencies = new DependencyContainer(buildItemResolver::resolveDependency);
@@ -214,6 +219,9 @@ public static class SettingsBuilder {
214219

215220
private String finalName;
216221

222+
/**
223+
* Creates a new instance.
224+
*/
217225
protected SettingsBuilder() {
218226
}
219227

@@ -241,6 +249,10 @@ public SettingsBuilder finalName(String finalName) {
241249
return this;
242250
}
243251

252+
/**
253+
* Builds the settings.
254+
* @return the settings
255+
*/
244256
public Settings build() {
245257
return new Settings(this);
246258
}
@@ -256,7 +268,11 @@ public static final class Settings {
256268

257269
private final String finalName;
258270

259-
protected Settings(SettingsBuilder builder) {
271+
/**
272+
* Creates a new instance.
273+
* @param builder the builder to use
274+
*/
275+
private Settings(SettingsBuilder builder) {
260276
this.defaultGoal = builder.defaultGoal;
261277
this.finalName = builder.finalName;
262278
}

0 commit comments

Comments
 (0)