Class MockOrganismFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<Organism>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.MockOrganismFetcher
-
- All Implemented Interfaces:
MockFetcher<Organism>
,OrganismFetcher
public class MockOrganismFetcher extends AbstractMockFetcher<Organism> implements OrganismFetcher
A mock fetcher for testing. It extends all the methods of the true fetcher, but does not access an external service. Instead, it holds a map which can be loaded with objects and keys. which are then returned. It attempts to replicate the responses of the fetcher in most scenarios.- Since:
- 24/05/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
localMap
-
-
Constructor Summary
Constructors Constructor Description MockOrganismFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Organism
fetchByTaxID(int taxID)
Finds the complete organism record matching the provided TaxID number.Collection<Organism>
fetchByTaxIDs(Collection<Integer> taxIDs)
Finds the complete organism records matching the provided TaxID numbers.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, getEntry, removeEntry
-
-
-
-
Method Detail
-
fetchByTaxID
public Organism fetchByTaxID(int taxID) throws BridgeFailedException
Finds the complete organism record matching the provided TaxID number.- Specified by:
fetchByTaxID
in interfaceOrganismFetcher
- Parameters:
taxID
- The taxID to search for- Returns:
- A matching organism, or null if one could not be found.
- Throws:
BridgeFailedException
- if any.
-
fetchByTaxIDs
public Collection<Organism> fetchByTaxIDs(Collection<Integer> taxIDs) throws BridgeFailedException
Finds the complete organism records matching the provided TaxID numbers.- Specified by:
fetchByTaxIDs
in interfaceOrganismFetcher
- Parameters:
taxIDs
- A collection of taxIDs to search for.- Returns:
- A collection of the matching organisms.
- Throws:
BridgeFailedException
- if any.
-
-