Skip to content

Commit

Permalink
+ better names
Browse files Browse the repository at this point in the history
  • Loading branch information
q3769 committed Aug 9, 2024
1 parent c57fbe6 commit 6205954
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

<groupId>io.github.q3769</groupId>
<artifactId>semver-maven-plugin</artifactId>
<version>20240116.0.202408090559</version>
<version>20240116.0.202408090614</version>
<packaging>maven-plugin</packaging>

<name>semver-maven-plugin</name>
Expand Down Expand Up @@ -229,7 +229,7 @@
<plugin>
<groupId>io.github.q3769</groupId>
<artifactId>semver-maven-plugin</artifactId>
<version>20240116.0.202408090559</version>
<version>20240116.0.202408090614</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
20 changes: 10 additions & 10 deletions src/main/java/q3769/maven/plugins/semver/SemverNormalVersion.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
public enum SemverNormalVersion {

/** Major version category. */
/** Major version */
MAJOR {
/**
* Gets the major version number from the given semantic version.
Expand All @@ -47,7 +47,7 @@ public enum SemverNormalVersion {
* @return the major version number
*/
@Override
public long getNormalVersionNumber(Version semver) {
public long getNumber(Version semver) {
return semver.majorVersion();
}

Expand All @@ -69,7 +69,7 @@ public Version incrementTo(long target, Version semver) {
}
},

/** Minor version category. */
/** Minor version */
MINOR {
/**
* Gets the minor version number from the given semantic version.
Expand All @@ -78,7 +78,7 @@ public Version incrementTo(long target, Version semver) {
* @return the minor version number
*/
@Override
public long getNormalVersionNumber(Version semver) {
public long getNumber(Version semver) {
return semver.minorVersion();
}

Expand All @@ -100,7 +100,7 @@ public Version incrementTo(long target, Version semver) {
}
},

/** Patch version category. */
/** Patch version */
PATCH {
/**
* Gets the patch version number from the given semantic version.
Expand All @@ -109,7 +109,7 @@ public Version incrementTo(long target, Version semver) {
* @return the patch version number
*/
@Override
public long getNormalVersionNumber(Version semver) {
public long getNumber(Version semver) {
return semver.patchVersion();
}

Expand Down Expand Up @@ -176,14 +176,14 @@ private static IllegalArgumentException incrementError(
* @param semver the semantic version
* @return the version number of the corresponding category
*/
public abstract long getNormalVersionNumber(Version semver);
public abstract long getNumber(Version semver);

/**
* Increments the version number of the corresponding category to the specified target value.
*
* @param target the target version number
* @param semver the original semantic version
* @return the new semantic version with the version number incremented
* @param target the target number to increment this normal version number to
* @param semver the original semantic version to increment
* @return the new semantic version with the normal version number incremented
*/
public abstract Version incrementTo(long target, Version semver);
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ enum CalendarVersionFormatter {
public static Version calendarIncrement(
Version original, @Nonnull SemverNormalVersion selectedNormalVersion)
throws MojoFailureException {
long selectedNormalVersionNumber = selectedNormalVersion.getNormalVersionNumber(original);
long selectedNormalVersionNumber = selectedNormalVersion.getNumber(original);
Instant now = Instant.now();
for (CalendarVersionFormatter formatter : values()) {
long updatedNormalVersionNumber = formatter.format(now);
Expand Down

0 comments on commit 6205954

Please sign in to comment.