refactor: Add setOption(key) method
Some checks are pending
bld-ci / build-bld-project (17) (push) Waiting to run
bld-ci / build-bld-project (21) (push) Waiting to run
bld-ci / build-bld-project (23) (push) Waiting to run

This commit is contained in:
Erik C. Thauvin 2025-01-23 12:37:02 -08:00
parent 6fea3d5fc6
commit 8d74b48e8d
Signed by: erik
GPG key ID: 776702A6A2DA330E
8 changed files with 26 additions and 22 deletions

View file

@ -64,7 +64,7 @@ public class AbstractJReleaserModelOperation<S extends AbstractJReleaserModelOpe
* @return this operation instance * @return this operation instance
*/ */
public S gitRootSearch() { public S gitRootSearch() {
setOption("--git-root-search", EMPTY); setOption("--git-root-search");
return self(); return self();
} }
@ -74,7 +74,7 @@ public class AbstractJReleaserModelOperation<S extends AbstractJReleaserModelOpe
* @return this operation instance * @return this operation instance
*/ */
public S strict() { public S strict() {
setOption("--strict", EMPTY); setOption("--strict");
return self(); return self();
} }

View file

@ -59,6 +59,10 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
return project_; return project_;
} }
protected void setOption(String key) {
setOption(key, EMPTY);
}
protected void setOption(String key, String value) { protected void setOption(String key, String value) {
options_.put(key, value); options_.put(key, value);
} }
@ -100,7 +104,7 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
* @return this operation instance * @return this operation instance
*/ */
public S debug() { public S debug() {
setOption("--debug", EMPTY); setOption("--debug");
return self(); return self();
} }
@ -162,7 +166,7 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
* @return this operation instance * @return this operation instance
*/ */
public S help() { public S help() {
setOption("--help", EMPTY); setOption("--help");
return self(); return self();
} }
@ -172,7 +176,7 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
* @return this operation instance * @return this operation instance
*/ */
public S info() { public S info() {
setOption("--info", EMPTY); setOption("--info");
return self(); return self();
} }
@ -225,7 +229,7 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
* @return this operation instance * @return this operation instance
*/ */
public S version() { public S version() {
setOption("--version", EMPTY); setOption("--version");
return self(); return self();
} }
@ -235,7 +239,7 @@ public abstract class AbstractJReleaserOperation<S extends AbstractJReleaserOper
* @return this operation instance * @return this operation instance
*/ */
public S warn() { public S warn() {
setOption("--warn", EMPTY); setOption("--warn");
return self(); return self();
} }
} }

View file

@ -30,7 +30,7 @@ public class AbstractJReleaserPlatformAwareModelOperation<S extends AbstractJRel
* @return this operation instance * @return this operation instance
*/ */
public S dryRun() { public S dryRun() {
setOption("--dry-run", EMPTY); setOption("--dry-run");
return self(); return self();
} }
@ -40,7 +40,7 @@ public class AbstractJReleaserPlatformAwareModelOperation<S extends AbstractJRel
* @return this operation instance * @return this operation instance
*/ */
public S selectCurrentPlatform() { public S selectCurrentPlatform() {
setOption("--select-current-platform", EMPTY); setOption("--select-current-platform");
return self(); return self();
} }

View file

@ -30,7 +30,7 @@ public class JReleaserChangelogOperation extends AbstractJReleaserModelOperation
* @return this operation instance * @return this operation instance
*/ */
public JReleaserChangelogOperation dryRun() { public JReleaserChangelogOperation dryRun() {
setOption("--dry-run", EMPTY); setOption("--dry-run");
return this; return this;
} }
} }

View file

@ -30,7 +30,7 @@ public class JReleaserConfigOperation extends AbstractJReleaserPlatformAwareMode
* @return this operation instance * @return this operation instance
*/ */
public JReleaserConfigOperation full() { public JReleaserConfigOperation full() {
setOption("--full", EMPTY); setOption("--full");
return this; return this;
} }
@ -40,7 +40,7 @@ public class JReleaserConfigOperation extends AbstractJReleaserPlatformAwareMode
* @return this operation instance * @return this operation instance
*/ */
public JReleaserConfigOperation announce() { public JReleaserConfigOperation announce() {
setOption("--announce", EMPTY); setOption("--announce");
return this; return this;
} }
@ -50,7 +50,7 @@ public class JReleaserConfigOperation extends AbstractJReleaserPlatformAwareMode
* @return this operation instance * @return this operation instance
*/ */
public JReleaserConfigOperation assembly() { public JReleaserConfigOperation assembly() {
setOption("--assembly", EMPTY); setOption("--assembly");
return this; return this;
} }
@ -60,7 +60,7 @@ public class JReleaserConfigOperation extends AbstractJReleaserPlatformAwareMode
* @return this operation instance * @return this operation instance
*/ */
public JReleaserConfigOperation changelog() { public JReleaserConfigOperation changelog() {
setOption("--changelog", EMPTY); setOption("--changelog");
return this; return this;
} }
@ -70,7 +70,7 @@ public class JReleaserConfigOperation extends AbstractJReleaserPlatformAwareMode
* @return this operation instance * @return this operation instance
*/ */
public JReleaserConfigOperation download() { public JReleaserConfigOperation download() {
setOption("--download", EMPTY); setOption("--download");
return this; return this;
} }
} }

View file

@ -41,7 +41,7 @@ public class JReleaserInitOperation extends AbstractJReleaserOperation<JReleaser
* @return this operation instance * @return this operation instance
*/ */
public JReleaserInitOperation overwrite() { public JReleaserInitOperation overwrite() {
setOption("--overwrite", EMPTY); setOption("--overwrite");
return this; return this;
} }

View file

@ -33,7 +33,7 @@ public class JReleaserTemplateEvalOperation extends AbstractJReleaserPlatformAwa
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateEvalOperation overwrite() { public JReleaserTemplateEvalOperation overwrite() {
setOption("--overwrite", EMPTY); setOption("--overwrite");
return this; return this;
} }
@ -43,7 +43,7 @@ public class JReleaserTemplateEvalOperation extends AbstractJReleaserPlatformAwa
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateEvalOperation announce() { public JReleaserTemplateEvalOperation announce() {
setOption("--announce", EMPTY); setOption("--announce");
return this; return this;
} }
@ -53,7 +53,7 @@ public class JReleaserTemplateEvalOperation extends AbstractJReleaserPlatformAwa
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateEvalOperation assembly() { public JReleaserTemplateEvalOperation assembly() {
setOption("--assembly", EMPTY); setOption("--assembly");
return this; return this;
} }
@ -63,7 +63,7 @@ public class JReleaserTemplateEvalOperation extends AbstractJReleaserPlatformAwa
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateEvalOperation changelog() { public JReleaserTemplateEvalOperation changelog() {
setOption("--changelog", EMPTY); setOption("--changelog");
return this; return this;
} }
@ -73,7 +73,7 @@ public class JReleaserTemplateEvalOperation extends AbstractJReleaserPlatformAwa
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateEvalOperation download() { public JReleaserTemplateEvalOperation download() {
setOption("--download", EMPTY); setOption("--download");
return this; return this;
} }

View file

@ -30,7 +30,7 @@ public class JReleaserTemplateGenerateOperation extends AbstractJReleaserOperati
* @return this operation instance * @return this operation instance
*/ */
public JReleaserTemplateGenerateOperation snapshot() { public JReleaserTemplateGenerateOperation snapshot() {
setOption("--snapshot", EMPTY); setOption("--snapshot");
return this; return this;
} }