Skip to content

Commit beb4734

Browse files
committed
Better API names.
Setters "set".
1 parent ffff375 commit beb4734

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/main/java/org/apache/commons/release/plugin/mojos/CommonsDistributionStagingMojo.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,9 @@ private List<File> buildReadmeAndHeaderHtmlFiles() throws MojoExecutionException
240240
StandardCharsets.UTF_8)) {
241241
// @formatter:off
242242
final ReadmeHtmlVelocityDelegate readmeHtmlVelocityDelegate = ReadmeHtmlVelocityDelegate.builder()
243-
.withArtifactId(project.getArtifactId())
244-
.withVersion(project.getVersion())
245-
.withSiteUrl(project.getUrl())
243+
.setArtifactId(project.getArtifactId())
244+
.setVersion(project.getVersion())
245+
.setSiteUrl(project.getUrl())
246246
.build();
247247
// @formatter:on
248248
readmeHtmlVelocityDelegate.render(readmeWriter);

src/main/java/org/apache/commons/release/plugin/velocity/ReadmeHtmlVelocityDelegate.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public ReadmeHtmlVelocityDelegate build() {
6969
* @param artifactId the {@link String} representing the maven artifactId.
7070
* @return the builder to continue building.
7171
*/
72-
public ReadmeHtmlVelocityDelegateBuilder withArtifactId(final String artifactId) {
72+
public ReadmeHtmlVelocityDelegateBuilder setArtifactId(final String artifactId) {
7373
this.artifactId = artifactId;
7474
return this;
7575
}
@@ -80,7 +80,7 @@ public ReadmeHtmlVelocityDelegateBuilder withArtifactId(final String artifactId)
8080
* @param siteUrl the site url to be used in the <code>README.html</code>
8181
* @return the builder to continue building.
8282
*/
83-
public ReadmeHtmlVelocityDelegateBuilder withSiteUrl(final String siteUrl) {
83+
public ReadmeHtmlVelocityDelegateBuilder setSiteUrl(final String siteUrl) {
8484
this.siteUrl = siteUrl;
8585
return this;
8686
}
@@ -91,7 +91,7 @@ public ReadmeHtmlVelocityDelegateBuilder withSiteUrl(final String siteUrl) {
9191
* @param version the maven version.
9292
* @return the builder to continue building.
9393
*/
94-
public ReadmeHtmlVelocityDelegateBuilder withVersion(final String version) {
94+
public ReadmeHtmlVelocityDelegateBuilder setVersion(final String version) {
9595
this.version = version;
9696
return this;
9797
}

src/test/java/org/apache/commons/release/plugin/velocity/ReadmeHtmlVelocityDelegateTest.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ final class ReadmeHtmlVelocityDelegateTest {
3232
@Test
3333
void testSuccessfulRun() throws IOException {
3434
final ReadmeHtmlVelocityDelegate delegate = ReadmeHtmlVelocityDelegate.builder()
35-
.withArtifactId("commons-text")
36-
.withVersion("1.4")
37-
.withSiteUrl("https://commons.apache.org/text")
35+
.setArtifactId("commons-text")
36+
.setVersion("1.4")
37+
.setSiteUrl("https://commons.apache.org/text")
3838
.build();
3939
try (Writer writer = delegate.render(new StringWriter())) {
4040
final String filledOutTemplate = writer.toString();
@@ -45,9 +45,9 @@ void testSuccessfulRun() throws IOException {
4545
@Test
4646
void testSuccessfulRunBcel() throws IOException {
4747
final ReadmeHtmlVelocityDelegate delegate = ReadmeHtmlVelocityDelegate.builder()
48-
.withArtifactId("bcel")
49-
.withVersion("1.5")
50-
.withSiteUrl("https://commons.apache.org/text")
48+
.setArtifactId("bcel")
49+
.setVersion("1.5")
50+
.setSiteUrl("https://commons.apache.org/text")
5151
.build();
5252
try (Writer writer = delegate.render(new StringWriter())) {
5353
final String filledOutTemplate = writer.toString();
@@ -58,9 +58,9 @@ void testSuccessfulRunBcel() throws IOException {
5858
@Test
5959
void testSuccessfulRunLang3() throws IOException {
6060
final ReadmeHtmlVelocityDelegate delegate = ReadmeHtmlVelocityDelegate.builder()
61-
.withArtifactId("commons-lang3")
62-
.withVersion("3.8.1")
63-
.withSiteUrl("https://commons.apache.org/text")
61+
.setArtifactId("commons-lang3")
62+
.setVersion("3.8.1")
63+
.setSiteUrl("https://commons.apache.org/text")
6464
.build();
6565
try (Writer writer = delegate.render(new StringWriter())) {
6666
final String filledOutTemplate = writer.toString();

0 commit comments

Comments
 (0)