![JAR search and dependency download from the Maven repository](/logo.png)
se.alipsa.groovy.resolver.Dependency.groovy Maven / Gradle / Ivy
package se.alipsa.groovy.resolver;
class Dependency {
private String groupId
private String artifactId
private String version
Dependency() {
}
Dependency(String groupId, String artifactId, String version) {
this.groupId = groupId
this.artifactId = artifactId
this.version = version
}
Dependency(String dependencyString) {
var parts = dependencyString.split(":")
if (parts.length != 3) {
throw new IllegalArgumentException("Incorrect format for dependency for " + dependencyString);
}
this.groupId = parts[0]
this.artifactId = parts[1]
this.version = parts[2]
}
void setGroupId(String groupId) {
this.groupId = groupId
}
String getGroupId() {
return groupId
}
void setArtifactId(String artifactId) {
this.artifactId = artifactId
}
String getArtifactId() {
return artifactId
}
void setVersion(String version) {
this.version = version
}
String getVersion() {
return version
}
@Override
String toString() {
return groupId + ":" + artifactId + ":" + version
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy