Skip to content

Introduce a Semver.Builder#233

Merged
piotrooo merged 2 commits intomainfrom
218-static-factory-constructor
Apr 8, 2024
Merged

Introduce a Semver.Builder#233
piotrooo merged 2 commits intomainfrom
218-static-factory-constructor

Conversation

@piotrooo
Copy link
Copy Markdown
Member

@piotrooo piotrooo commented Apr 5, 2024

This PR introduces a Semver.Builder which helps with programmatically creating Semver objects.

The newly introduced API looks like:

Semver semver = Semver.of()
        .withMajor(1)
        .withMinor(2)
        .withBuild("5bb76cdb")
        .toSemver();

And is an equivalent of:

Semver semver = new Semver("1.2.0+5bb76cdb");

@piotrooo piotrooo added the enhancement New feature or request label Apr 5, 2024
@piotrooo piotrooo self-assigned this Apr 5, 2024
@piotrooo piotrooo linked an issue Apr 5, 2024 that may be closed by this pull request
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 5, 2024

Codecov Report

Attention: Patch coverage is 73.17073% with 11 lines in your changes are missing coverage. Please review.

Project coverage is 90.94%. Comparing base (16a14a4) to head (59418e9).

Files Patch % Lines
src/main/java/org/semver4j/Semver.java 73.17% 11 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #233      +/-   ##
============================================
- Coverage     92.17%   90.94%   -1.23%     
+ Complexity      268      266       -2     
============================================
  Files            21       21              
  Lines           639      674      +35     
  Branches        103      103              
============================================
+ Hits            589      613      +24     
- Misses           17       28      +11     
  Partials         33       33              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@piotrooo piotrooo merged commit d072b67 into main Apr 8, 2024
@piotrooo piotrooo deleted the 218-static-factory-constructor branch April 8, 2024 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

static factory constructor.

2 participants