Class MockGeneFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<Collection<Gene>>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.MockGeneFetcher
-
- All Implemented Interfaces:
GeneFetcher,InteractorFetcher<Gene>,MockFetcher<Collection<Gene>>
public class MockGeneFetcher extends AbstractMockFetcher<Collection<Gene>> implements GeneFetcher
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:
23/05/13
- Version:
- $Id$
- Author:
- Marine Dumousseau (marine@ebi.ac.uk)
-
-
Field Summary
-
Fields inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
localMap
-
-
Constructor Summary
Constructors Constructor Description MockGeneFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Gene>fetchByIdentifier(String identifier)Takes a string identifier and returns the interactors which match.Collection<Gene>fetchByIdentifier(String identifier, int taxID)fetchByIdentifier.Collection<Gene>fetchByIdentifiers(Collection<String> identifiers)Takes a collection of string identifiers and returns the interactors which match.Collection<Gene>fetchByIdentifiers(Collection<String> identifiers, int taxID)fetchByIdentifiers.protected Collection<Gene>getEntry(String identifier)getEntry.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, removeEntry
-
-
-
-
Method Detail
-
getEntry
protected Collection<Gene> getEntry(String identifier) throws BridgeFailedException
getEntry.
- Overrides:
getEntryin classAbstractMockFetcher<Collection<Gene>>- Parameters:
identifier- aStringobject.- Returns:
- a T object.
- Throws:
BridgeFailedException- if any.
-
fetchByIdentifier
public Collection<Gene> fetchByIdentifier(String identifier) throws BridgeFailedException
Takes a string identifier and returns the interactors which match. Returns an empty collection of no entries are returned- Specified by:
fetchByIdentifierin interfaceInteractorFetcher<Gene>- Parameters:
identifier- The identifier to search for.- Returns:
- The proteins which match the search term. Empty if no matches.
- Throws:
BridgeFailedException- A problem has been encountered when contacting the service
-
fetchByIdentifiers
public Collection<Gene> fetchByIdentifiers(Collection<String> identifiers) throws BridgeFailedException
Takes a collection of string identifiers and returns the interactors which match. Returns an empty collection of no entries are returned.- Specified by:
fetchByIdentifiersin interfaceInteractorFetcher<Gene>- Parameters:
identifiers- The identifiers to search for.- Returns:
- The proteins which match the search term. Empty if no matches.
- Throws:
BridgeFailedException- if any.
-
fetchByIdentifier
public Collection<Gene> fetchByIdentifier(String identifier, int taxID) throws BridgeFailedException
fetchByIdentifier.
- Specified by:
fetchByIdentifierin interfaceGeneFetcher- Parameters:
identifier- The identifier of the genetaxID- The organism the gene is from.- Returns:
- The genes matching the search terms.
- Throws:
BridgeFailedException- if any.
-
fetchByIdentifiers
public Collection<Gene> fetchByIdentifiers(Collection<String> identifiers, int taxID) throws BridgeFailedException
Description copied from interface:GeneFetcherfetchByIdentifiers.
- Specified by:
fetchByIdentifiersin interfaceGeneFetcher- Parameters:
identifiers- The identifiers of the genetaxID- The organism the gene is from.- Returns:
- The genes matching the search terms.
- Throws:
BridgeFailedException- if any.
-
-