Class MockProteinFetcher
- java.lang.Object
-
- psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher<Collection<Protein>>
-
- psidev.psi.mi.jami.bridges.fetcher.mock.MockProteinFetcher
-
- All Implemented Interfaces:
InteractorFetcher<Protein>,MockFetcher<Collection<Protein>>,ProteinFetcher
public class MockProteinFetcher extends AbstractMockFetcher<Collection<Protein>> implements ProteinFetcher
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 MockProteinFetcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<Protein>fetchByIdentifier(String identifier)Takes a string identifier and returns the interactors which match.Collection<Protein>fetchByIdentifiers(Collection<String> identifiers)Takes a collection of string identifiers and returns the interactors which match.protected Collection<Protein>getEntry(String identifier)getEntry.-
Methods inherited from class psidev.psi.mi.jami.bridges.fetcher.mock.AbstractMockFetcher
addEntry, clearEntries, removeEntry
-
-
-
-
Method Detail
-
getEntry
protected Collection<Protein> getEntry(String identifier) throws BridgeFailedException
getEntry.
- Overrides:
getEntryin classAbstractMockFetcher<Collection<Protein>>- Parameters:
identifier- aStringobject.- Returns:
- a T object.
- Throws:
BridgeFailedException- if any.
-
fetchByIdentifier
public Collection<Protein> 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<Protein>- 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<Protein> 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<Protein>- Parameters:
identifiers- The identifiers to search for.- Returns:
- The proteins which match the search term. Empty if no matches.
- Throws:
BridgeFailedException- if any.
-
-