/** * @param version other version to compare to * @return {@code true} if this version is greater than {@code version} */ public boolean isGreaterThan(Version version) { return !version.isUnknown() && compareTo(version) > 0; }
/** * @param version other version to compare to * @return {@code true} if this version is less than {@code version} */ public boolean isLessThan(Version version) { return !isUnknown() && compareTo(version) < 0; }
/** * @param version other version to compare to * @return {@code true} if this version is unknown or if this version is less than {@code version} */ public boolean isUnknownOrLessThan(Version version) { return isUnknown() || compareTo(version) < 0; }
/** * @param version other version to compare to * @return {@code true} if this version is unknown or if this version is less than {@code version} */ public boolean isUnknownOrLessThan(Version version) { return isUnknown() || compareTo(version) < 0; }
/** * @param version other version to compare to * @return {@code true} if this version is unknown or if this version is less than or equal to {@code version} */ public boolean isUnknownOrLessOrEqual(Version version) { return isUnknown() || compareTo(version) <= 0; }
/** * @param version other version to compare to * @return {@code true} if this version is unknown or if this version is less than or equal to {@code version} */ public boolean isUnknownOrLessOrEqual(Version version) { return isUnknown() || compareTo(version) <= 0; }
/** * @param version other version to compare to * @return {@code true} if this version is less than {@code version} */ public boolean isLessThan(Version version) { return !isUnknown() && compareTo(version) < 0; }
/** * @param version other version to compare to * @return {@code true} if this version is greater than {@code version} */ public boolean isGreaterThan(Version version) { return !version.isUnknown() && compareTo(version) > 0; }
private void validateClusterVersionChange(Version newClusterVersion) { if (!clusterVersion.isUnknown() && clusterVersion.getMajor() != newClusterVersion.getMajor()) { throw new IllegalArgumentException("Transition to requested version " + newClusterVersion + " not allowed for current cluster version " + clusterVersion); } }
private void validateClusterVersionChange(Version newClusterVersion) { if (!clusterVersion.isUnknown() && clusterVersion.getMajor() != newClusterVersion.getMajor()) { throw new IllegalArgumentException("Transition to requested version " + newClusterVersion + " not allowed for current cluster version " + clusterVersion); } }
protected boolean isClusterVersionUnknown() { Version clusterVersion = getNodeEngine().getClusterService().getClusterVersion(); return clusterVersion.isUnknown(); } }
protected boolean isClusterVersionUnknown() { Version clusterVersion = getNodeEngine().getClusterService().getClusterVersion(); return clusterVersion.isUnknown(); } }
private Version getClusterOrNodeVersion() { if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) { return node.getClusterService().getClusterVersion(); } else { String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION); return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion() : node.getVersion().asVersion(); } }
private Version getClusterOrNodeVersion() { if (node.getClusterService() != null && !node.getClusterService().getClusterVersion().isUnknown()) { return node.getClusterService().getClusterVersion(); } else { String overriddenClusterVersion = node.getProperties().getString(GroupProperty.INIT_CLUSTER_VERSION); return (overriddenClusterVersion != null) ? MemberVersion.of(overriddenClusterVersion).asVersion() : node.getVersion().asVersion(); } }