@Override public Integer visitVersion(OrderableSlsVersion version) { // o1 is smaller if it satisfies the max constraint of o2 return o2.isSatisfiedBy(version) ? -1 : 1; }
@Override public Integer visitVersion(OrderableSlsVersion version) { // o1 is smaller if it satisfies the max constraint of o2 return o2.isSatisfiedBy(version) ? -1 : 1; }
private static boolean satisfiesMaxVersion(Optional<MaximumVersion> maximumVersion, OrderableSlsVersion version) { // If maximumVersion is 1.5.x we should still accept e.g. 1.3.0 so we use '>= 0' // (comparison result is from the point of view of the matcher) return maximumVersion.map(maxVer -> maxVer.isSatisfiedBy(version)).orElse(true); }
private static boolean satisfiesMaxVersion(Optional<MaximumVersion> maximumVersion, OrderableSlsVersion version) { // If maximumVersion is 1.5.x we should still accept e.g. 1.3.0 so we use '>= 0' // (comparison result is from the point of view of the matcher) return maximumVersion.map(maxVer -> maxVer.isSatisfiedBy(version)).orElse(true); }