Class ChainedEntityMapper<T extends Identifiable>
- java.lang.Object
-
- ubic.gemma.core.loader.util.mapper.ChainedEntityMapper<T>
-
- All Implemented Interfaces:
EntityMapper<T>
public class ChainedEntityMapper<T extends Identifiable> extends Object implements EntityMapper<T>
Implementation of a chain of entity mappers.- Author:
- poirigui
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ubic.gemma.core.loader.util.mapper.EntityMapper
EntityMapper.MappingStatistics, EntityMapper.StatefulEntityMapper<T extends Identifiable>
-
-
Constructor Summary
Constructors Constructor Description ChainedEntityMapper(EntityMapper<T>... chain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Collection<T> candidates, String identifier)
Check if any of the candidates can be mapped to the identifier.boolean
containsAny(Collection<T> candidates, Collection<String> identifiers)
Check if any of the candidates can be mapped to any of the identifiers.EntityMapper.StatefulEntityMapper<T>
forCandidates(Collection<T> candidates)
Create a stateful mapper for a set of candidates.EntityMapper.MappingStatistics
getMappingStatistics(Collection<T> candidates, Collection<String> identifiers)
Calculate mapping statistics for a set of gene identifiers and candidates.String
getName()
Obtain the name of the mapping strategy.Set<T>
matchAll(Collection<T> candidates, String identifier)
Match the identifier to all the candidates.Optional<T>
matchOne(Collection<T> candidates, String identifier)
Map the identifier to a single candidate.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface ubic.gemma.core.loader.util.mapper.EntityMapper
matchAll, matchOne
-
-
-
-
Constructor Detail
-
ChainedEntityMapper
public ChainedEntityMapper(EntityMapper<T>... chain)
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:EntityMapper
Obtain the name of the mapping strategy.- Specified by:
getName
in interfaceEntityMapper<T extends Identifiable>
-
forCandidates
public EntityMapper.StatefulEntityMapper<T> forCandidates(Collection<T> candidates)
Description copied from interface:EntityMapper
Create a stateful mapper for a set of candidates.- Specified by:
forCandidates
in interfaceEntityMapper<T extends Identifiable>
-
contains
public boolean contains(Collection<T> candidates, String identifier)
Description copied from interface:EntityMapper
Check if any of the candidates can be mapped to the identifier.- Specified by:
contains
in interfaceEntityMapper<T extends Identifiable>
-
containsAny
public boolean containsAny(Collection<T> candidates, Collection<String> identifiers)
Description copied from interface:EntityMapper
Check if any of the candidates can be mapped to any of the identifiers.- Specified by:
containsAny
in interfaceEntityMapper<T extends Identifiable>
-
matchOne
public Optional<T> matchOne(Collection<T> candidates, String identifier)
Description copied from interface:EntityMapper
Map the identifier to a single candidate.If more than one candidate matches the identifier,
Optional.empty()
is returned.- Specified by:
matchOne
in interfaceEntityMapper<T extends Identifiable>
-
matchAll
public Set<T> matchAll(Collection<T> candidates, String identifier)
Description copied from interface:EntityMapper
Match the identifier to all the candidates.- Specified by:
matchAll
in interfaceEntityMapper<T extends Identifiable>
-
getMappingStatistics
public EntityMapper.MappingStatistics getMappingStatistics(Collection<T> candidates, Collection<String> identifiers)
Description copied from interface:EntityMapper
Calculate mapping statistics for a set of gene identifiers and candidates.- Specified by:
getMappingStatistics
in interfaceEntityMapper<T extends Identifiable>
-
-