@Override public int hashCode() { int result = 13; if (getMin() == null) { result += 1; } else { result += getMin().hashCode(); } result *= isMinInclusive() ? 1 : 2; if (getMax() == null) { result -= 3; } else { result -= getMax().hashCode(); } result *= isMaxInclusive() ? 2 : 3; return result; }
ranges.add(parseVersionRange(version)); else ranges.add(new SingleVersionRange(SingleVersion.valueOf(version))); ranges.add(new SingleVersionRange(SingleVersion.valueOf(process)));
static CoordinatePattern fromCoordinatePattern(String coordinates) { String[] parts = coordinates.split("\\s*:\\s*"); if (parts.length < 3) throw new IllegalArgumentException("Expected GAV definition format is 'GROUP_ID:ARTIFACT_ID:VERSION_OR_RANGE[:CLASSIFIER]', was: " + coordinates); CoordinateBuilder coordinate = CoordinateBuilder.create() .setGroupId(parts[0]) .setArtifactId(parts[1]); VersionRange version = null; if (parts[2].equals("*")) version = new EmptyVersionRange(); // Range - (1.0,2.0] or [1.0,2.0) etc. else if (parts[2].matches("^(\\[|\\()[^,]+(,[^,]+)?(\\]|\\))$")) version = Versions.parseMultipleVersionRange(parts[2]); else version = new SingleVersionRange(new SingleVersion(parts[2])); if (parts.length >= 4) coordinate.setClassifier(parts[3]); return new CoordinatePattern(coordinate, version); }
static CoordinatePattern fromCoordinatePattern(String coordinates) { String[] parts = coordinates.split("\\s*:\\s*"); if (parts.length < 3) throw new IllegalArgumentException("Expected GAV definition format is 'GROUP_ID:ARTIFACT_ID:VERSION_OR_RANGE[:CLASSIFIER]', was: " + coordinates); CoordinateBuilder coordinate = CoordinateBuilder.create() .setGroupId(parts[0]) .setArtifactId(parts[1]); VersionRange version = null; if (parts[2].matches("\\*")) version = new EmptyVersionRange(); else if (parts[2].matches("^(\\[|\\()[^,]+(,?[^,]+)+(\\]|\\))$")) version = Versions.parseMultipleVersionRange(parts[2]); else version = new SingleVersionRange(new SingleVersion(parts[2])); if (parts.length >= 4) coordinate.setClassifier(parts[3]); return new CoordinatePattern(coordinate, version); }
if (getMin() != null) if (!getMin().equals(restriction.getMin())) if (isMinInclusive() != restriction.isMinInclusive()) if (getMax() != null) if (!getMax().equals(restriction.getMax())) if (isMaxInclusive() != restriction.isMaxInclusive())
static CoordinatePattern fromCoordinatePattern(String coordinates) { String[] parts = coordinates.split("\\s*:\\s*"); if (parts.length < 3) throw new IllegalArgumentException("Expected GAV definition format is 'GROUP_ID:ARTIFACT_ID:VERSION_OR_RANGE[:CLASSIFIER]', was: " + coordinates); CoordinateBuilder coordinate = CoordinateBuilder.create() .setGroupId(parts[0]) .setArtifactId(parts[1]); VersionRange version = null; if (parts[2].equals("*")) version = new EmptyVersionRange(); // Range - (1.0,2.0] or [1.0,2.0) etc. else if (parts[2].matches("^(\\[|\\()[^,]+(,[^,]+)?(\\]|\\))$")) version = Versions.parseMultipleVersionRange(parts[2]); else version = new SingleVersionRange(new SingleVersion(parts[2])); if (parts.length >= 4) coordinate.setClassifier(parts[3]); return new CoordinatePattern(coordinate, version); }