in osgi-featuremodel/src/main/java/org/apache/sling/feature/osgi/impl/IDImpl.java [64:119]
public IDImpl(String groupId, String artifactId, String version, String type,
String classifier)
throws NullPointerException, IllegalArgumentException {
Objects.requireNonNull(groupId, "groupId");
Objects.requireNonNull(artifactId, "artifact");
Objects.requireNonNull(version, "version");
if (groupId.isEmpty()) {
throw new IllegalArgumentException("groupId must not be empty");
}
if (artifactId.isEmpty()) {
throw new IllegalArgumentException("artifactId must not be empty");
}
if (version.isEmpty()) {
throw new IllegalArgumentException("version must not be empty");
}
if (type != null && type.isEmpty()) {
throw new IllegalArgumentException("type must not be empty");
}
if (classifier != null && classifier.isEmpty()) {
throw new IllegalArgumentException("classifier must not be empty");
}
if (groupId.contains(":")) {
throw new IllegalArgumentException(
"groupId must not contain a colon `:`");
}
if (artifactId.contains(":")) {
throw new IllegalArgumentException(
"artifactId must not contain a colon `:`");
}
if (version.contains(":")) {
throw new IllegalArgumentException(
"version must not contain a colon `:`");
}
if (type != null && type.contains(":")) {
throw new IllegalArgumentException(
"type must not contain a colon `:`");
}
if (classifier != null && classifier.contains(":")) {
throw new IllegalArgumentException(
"classifier must not contain a colon `:`");
}
if (type == null && classifier != null) {
throw new IllegalArgumentException(
"type must not be `null` if a classifier is set");
}
this.groupId = groupId;
this.artifactId = artifactId;
this.version = version;
this.type = type;
this.classifier = classifier;
}