Package org.bridgedb
Class AbstractIDMapperCapabilities
- java.lang.Object
-
- org.bridgedb.AbstractIDMapperCapabilities
-
- All Implemented Interfaces:
IDMapperCapabilities
public abstract class AbstractIDMapperCapabilities extends Object implements IDMapperCapabilities
Simple implementation of IDMapperCapabilities, which assumes that the supported datasources are the same for target and source, and that the supported data sources and properties are static and known at creation time.
-
-
Constructor Summary
Constructors Constructor Description AbstractIDMapperCapabilities(Set<DataSource> supportedDataSources, boolean freeSearchSupported, Map<String,String> props)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>getKeys()StringgetProperty(String key)Return a value for a property, or null if this property is not defined.Set<DataSource>getSupportedSrcDataSources()Set<DataSource>getSupportedTgtDataSources()booleanisFreeSearchSupported()booleanisMappingSupported(DataSource src, DataSource tgt)
-
-
-
Constructor Detail
-
AbstractIDMapperCapabilities
public AbstractIDMapperCapabilities(Set<DataSource> supportedDataSources, boolean freeSearchSupported, Map<String,String> props)
- Parameters:
supportedDataSources- Supported DataSources. IDMappers are usually symmetrical, so in the default implementation supportedDataSources is both target and source DataSources.props- properties, may be null.freeSearchSupported- if free search is supported or not
-
-
Method Detail
-
getKeys
public Set<String> getKeys()
- Specified by:
getKeysin interfaceIDMapperCapabilities- Returns:
- the keys of all properties. Implementations may return an empty set but never null.
-
getProperty
public String getProperty(String key)
Return a value for a property, or null if this property is not defined. Implementations are free to choose a set of properties. Suggested properties:- Version
- DateCreated
- SourceDatabase
- SourceDatabaseVersion
- Species
- Specified by:
getPropertyin interfaceIDMapperCapabilities- Parameters:
key- key- Returns:
- property string
-
getSupportedSrcDataSources
public Set<DataSource> getSupportedSrcDataSources() throws IDMapperException
- Specified by:
getSupportedSrcDataSourcesin interfaceIDMapperCapabilities- Returns:
- supported source ID types
- Throws:
IDMapperException- if supported DataSources could not be determined because of service unavailability.
-
getSupportedTgtDataSources
public Set<DataSource> getSupportedTgtDataSources() throws IDMapperException
- Specified by:
getSupportedTgtDataSourcesin interfaceIDMapperCapabilities- Returns:
- supported target ID types
- Throws:
IDMapperException- if supported DataSources could not be determined because of service unavailability.
-
isMappingSupported
public boolean isMappingSupported(DataSource src, DataSource tgt) throws IDMapperException
- Specified by:
isMappingSupportedin interfaceIDMapperCapabilities- Parameters:
src- source data sourcetgt- target data source- Returns:
- true if mapping is supported from src to des
- Throws:
IDMapperException- if service is unavailable
-
isFreeSearchSupported
public boolean isFreeSearchSupported()
- Specified by:
isFreeSearchSupportedin interfaceIDMapperCapabilities- Returns:
- true if free text search is supported, false otherwise.
-
-