sls-versions/src/main/java/com/palantir/sls/versions/SlsVersionMatcher.java
/**
     * Returns 0 iff the given version matches this matcher, i.e., if the non-{@code x} major/minor/patch versions of
     * this matcher are identical to the respective major/minor/patch versions of the given version. Note that despite
     * the syntactic similarity between matchers and {@link SlsVersionType#RELEASE release versions}, a matcher can
     * match release snapshot, release, release-candidate, and release-candidate snapshot versions. For example, matcher
     * {@code 1.x.x} matches versions {@code 1.0.0} and {@code 1.2.3-rc4}, but it does not match versions {@code 2.0.0}
     * or {@code 0.1.0-rc4}.
     *
     * <p>Returns a negative number if any existing component is less than the given version and a positive number if
     * any existing component is greater than the given version. For example matcher {@code 1.2.x} is less than
     * {@code 1.3.2} and {@code 1.2.x} is greater than {@code 1.1.1}.
     */
Returns 0 iff the given version matches this matcher, i.e., if the non- x major/minor/patch versions of
this matcher are identical to the respective major/minor/patch versions of the given version. Note that despite
the syntactic similarity between matchers and  SlsVersionType#RELEASE release versions, a matcher can
match release snapshot, release, release-candidate, and release-candidate snapshot versions.

Returns a negative number if any existing component is less than the given version and a positive number if
any existing component is greater than the given version.
Returns 0 iff the given version matches this matcher i . e . if the non - x major / minor / patch versions of this matcher are identical to the respective major / minor / patch versions of the given version . Note that despite the syntactic similarity between matchers and SlsVersionType#RELEASE release versions a matcher can match release snapshot release release - candidate and release - candidate snapshot versions . Returns a negative number if any existing component is less than the given version and a positive number if any existing component is greater than the given version .
public int compare(OrderableSlsVersion version) {
        if (concreteSlsVersion().isPresent()) {
            return VersionComparator.INSTANCE.compare(concreteSlsVersion().get(), version);
        }
        if (getMajorVersionNumber().isPresent()) {
            int comparison = Integer.compare(getMajorVersionNumber().getAsInt(), version.getMajorVersionNumber());
            if (comparison != 0) {
                return comparison;
            }
        }
        if (getMinorVersionNumber().isPresent()) {
            int comparison = Integer.compare(getMinorVersionNumber().getAsInt(), version.getMinorVersionNumber());
            if (comparison != 0) {
                return comparison;
            }
        }
        if (getPatchVersionNumber().isPresent()) {
            int comparison = Integer.compare(getPatchVersionNumber().getAsInt(), version.getPatchVersionNumber());
            if (comparison != 0) {
                return comparison;
            }
        }
        return 0;
    }
public int compare ( OrderableSlsVersion version ) { if ( concreteSlsVersion ( ) . isPresent ( ) ) { return VersionComparator . INSTANCE . compare ( concreteSlsVersion ( ) . get ( ) , version ) ; } if ( getMajorVersionNumber ( ) . isPresent ( ) ) { int comparison = Integer . compare ( getMajorVersionNumber ( ) . getAsInt ( ) , version . getMajorVersionNumber ( ) ) ; if ( comparison != 0 ) { return comparison ; } } if ( getMinorVersionNumber ( ) . isPresent ( ) ) { int comparison = Integer . compare ( getMinorVersionNumber ( ) . getAsInt ( ) , version . getMinorVersionNumber ( ) ) ; if ( comparison != 0 ) { return comparison ; } } if ( getPatchVersionNumber ( ) . isPresent ( ) ) { int comparison = Integer . compare ( getPatchVersionNumber ( ) . getAsInt ( ) , version . getPatchVersionNumber ( ) ) ; if ( comparison != 0 ) { return comparison ; } } return 0 ; }
Returns 0 iff the given version matches this matcher, i.e., if the non-{@code x} major/minor/patch versions of
 this matcher are identical to the respective major/minor/patch versions of the given version.
Returns 0 iff the given version matches this matcher i . e . if the non - { @code x } major / minor / patch versions of this matcher are identical to the respective major / minor / patch versions of the given version .