com.atlassian.bamboo.util
Class RepositoryCollections

java.lang.Object
  extended by com.atlassian.bamboo.util.RepositoryCollections

public final class RepositoryCollections
extends java.lang.Object

A bunch of static methods that are useful when dealing with collections of repositories.

This class is not meant to be instantiated, and has a private constructor to prevent it being instantiated.

Since:
v4.1

Method Summary
static com.atlassian.fugue.Option<Repository> chooseRepository(java.util.Collection<? extends Repository> candidateRepositories, java.lang.String defaultRepositoryKey)
          Chooses a repository from a collection of candidate repositories, taking into consideration the given default repository, if any.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

chooseRepository

@NotNull
public static com.atlassian.fugue.Option<Repository> chooseRepository(@Nullable
                                                                              java.util.Collection<? extends Repository> candidateRepositories,
                                                                              @Nullable
                                                                              java.lang.String defaultRepositoryKey)
Chooses a repository from a collection of candidate repositories, taking into consideration the given default repository, if any.

This implementation chooses a repository in this fashion:

Subversion, if available, unless the given default repository name corresponds to one of the candidate repositories, in which case the corresponding repository is chosen.

Parameters:
candidateRepositories - the collection of repositories from which the choice is made
defaultRepositoryKey - the key of the default repository
Returns:
one of the candidate repositories as an Option


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.