Set<ExternalId> externalIds = requirement.getIdentifiers().getExternalIds();
ArgumentChecker.isTrue(externalIds.size() == 1, "One (and only one) external id must be specified currently.");
ExternalId externalId = Iterables.get(externalIds, 0);
uri = DependencyGraphTraceProviderResource.uriValueRequirementByExternalId(uri, constrainedValueName, targetType, externalId);
} else if (targetReference instanceof ComputationTargetSpecification) {
UniqueId uniqueId = ((ComputationTargetSpecification) targetReference).getUniqueId();
uri = DependencyGraphTraceProviderResource.uriValueRequirementByUniqueId(uri, constrainedValueName, targetType, uniqueId);
} else {
throw new IllegalArgumentException(format("Unrecognised ValueRequirement class: %s", ValueRequirement.class.getName()));
}
}