Coder Social home page Coder Social logo

java.semver's People

Contributors

kherge avatar

Stargazers

 avatar

Watchers

 avatar

java.semver's Issues

Use `Optional` for retrieving metadata.

Problem

The getBuild() and getPreRelease() methods will return empty arrays if metadata is not present. While not terrible, checks can lead to the following type of code:

String[] metadata = version.getPreRelease();

if (metadata.length > 0) {
    // ...
}

Resolution

It would be a minor convenience if an Optional was returned.

version.getPreRelease().ifPresent(doSomething);

Move and rename `InvalidVersionException` to `Version.InvalidStringException`.

While VersionException may be applicable to other library classes in the future, the InvalidVersionException is a tad bit misleading and is strictly used by the parser inside of the Version class. To clear things up, InvalidVersionException should be made an inner class to Version and renamed to InvalidStringException.

README is missing stability constraints in example.

Problem

When the pre and stable constraints were added, the documentation for version constraints was not updated to include their use.

Resolution

Add new and constraints to the example using pre and stable.

Incrementing a version should reset lower values.

  • When the major version number is incremented.
    • The minor and patch version number should be set to 0 (zero).
    • The pre-release and build metadata should be cleared.
  • When the minor version number is incremented.
    • The patch version number should be set to 0 (zero).
    • The pre-release and build metadata should be cleared.
  • When the patch version number is incremented.
    • The pre-release and build metadata should be cleared.

Add stability constraints.

Problem

There is no bundled constraints for enforcing stability.

Resolution

Create two new constraints.

  • PreRelease - Requires that a version be a pre-release version.
  • Stable - Requires that the version be a stable version.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.