public class FakeRepositorySourceProvider extends java.lang.Object implements RepositorySourceProvider
RepositorySourceProvider that just returns a given list of sources, for testing.| Constructor and Description |
|---|
FakeRepositorySourceProvider(java.util.List<RepositorySource> sources) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addSource(RepositorySource source)
Add a source to this provider, if this provider is editable.
|
java.util.List<RepositorySource> |
getSources(Downloader downloader,
ProgressIndicator logger,
boolean forceRefresh)
Gets the
RepositorySources from this provider. |
boolean |
isModifiable() |
boolean |
removeSource(RepositorySource source)
Remove the given source from this provider, if this provider is editable.
|
void |
save(ProgressIndicator progress)
If any changes have been made, persist them.
|
public FakeRepositorySourceProvider(java.util.List<RepositorySource> sources)
@NonNull public java.util.List<RepositorySource> getSources(Downloader downloader, ProgressIndicator logger, boolean forceRefresh)
RepositorySourceProviderRepositorySources from this provider.getSources in interface RepositorySourceProviderdownloader - The Downloader, if required by this provider.logger - A ProgressIndicator to be used for showing progress and logging.forceRefresh - If true, this provider should refresh its list of sources, rather than
using a cached version.public boolean addSource(@NonNull
RepositorySource source)
RepositorySourceProviderRepositorySourceProvider.getSources(Downloader, ProgressIndicator, boolean), but not
persisted until RepositorySourceProvider.save(ProgressIndicator) is called.addSource in interface RepositorySourceProvidersource - The source to add.true if the source was successfully added, false otherwise.public boolean isModifiable()
isModifiable in interface RepositorySourceProvidertrue if this provider can be edited (that is, it has a facility for saving
and loading changes), false otherwise.public void save(@NonNull
ProgressIndicator progress)
RepositorySourceProvidersave in interface RepositorySourceProviderpublic boolean removeSource(@NonNull
RepositorySource source)
RepositorySourceProviderremoveSource in interface RepositorySourceProvidersource - The source to remove.true if the source was successfully removed, false otherwise.RepositorySourceProvider.addSource(RepositorySource)