/** * * @param version * version for the verioninfo */ public VersionRange(String version) { this.version = version; processVersionAttribute(version); }
/** * This method should be used to create a version range from a single * version string. * @param version * version for the versioninfo * @param exactVersion * whether this is an exact version {@code true} or goes to infinity * {@code false} */ public VersionRange(String version, boolean exactVersion) { if (exactVersion) { // Do not store this string as it might be just a version, or a range! processExactVersionAttribute(version); } else { this.version = version; processVersionAttribute(this.version); } assertInvariants(); }
/** * this is designed for deployed-version as that is the exact version. * * @param version * @return * @throws IllegalArgumentException */ private boolean processExactVersionAttribute(String version) throws IllegalArgumentException { boolean success = processVersionAttribute(version); if (maximumVersion == null) { maximumVersion = minimumVersion; } if (!minimumVersion.equals(maximumVersion)) { throw new IllegalArgumentException(MessageUtil.getMessage("UTIL0011E", version)); } if (!!!isExactVersion()) { throw new IllegalArgumentException(MessageUtil.getMessage("UTIL0009E", version)); } return success; }