/** * Removes the repo as one that this package version is related to. The mapping that was removed is returned; if * the given package version was not a member of the repo, <code>null</code> is returned. * * @param repo * * @return the mapping that was removed or <code>null</code> if this package version was not mapped to the given * repo */ public RepoPackageVersion removeRepo(Repo repo) { if ((this.repoPackageVersions == null) || (repo == null)) { return null; } RepoPackageVersion doomed = null; for (RepoPackageVersion cpv : this.repoPackageVersions) { if (repo.equals(cpv.getRepoPackageVersionPK().getRepo())) { doomed = cpv; repo.removePackageVersion(this); break; } } if (doomed != null) { this.repoPackageVersions.remove(doomed); } return doomed; }