コード例 #1
0
  public List<String> getIdsFromName(final String name) {
    notNull("name", name);
    Collection<Version> versions = versionManager.getVersionsByName(name);

    Function<Version, String> function =
        new Function<Version, String>() {
          public String get(final Version input) {
            return input.getId().toString();
          }
        };

    return CollectionUtil.transform(versions, function);
  }
コード例 #2
0
 public boolean nameExists(final String name) {
   notNull("name", name);
   Collection<Version> versions = versionManager.getVersionsByName(name);
   return !versions.isEmpty();
 }