Interface EntityReplacementStrategy
-
- All Known Implementing Classes:
EntityReplacementStrategyImpl
public interface EntityReplacementStrategyGeneric interface to support swapping out one entity with another. Use primarily in GTFS loading to consolidate stops from GTFS feeds from separate agencies that have stops in common.- Author:
- bdferris
- See Also:
EntityReplacementStrategyFactory
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SerializablegetReplacementEntityId(Class<?> entityType, Serializable id)booleanhasReplacementEntities(Class<?> entityType)booleanhasReplacementEntity(Class<?> entityType, Serializable id)<T> TlogReplacement(Class<T> type, Serializable id, Serializable replacementId, T originalEntity, T replacementEntity)Log that replacement has occurred.voidsetEntityReplacementLogger(EntityReplacementLogger logger)optionally inject a logger for recording replacements
-
-
-
Method Detail
-
setEntityReplacementLogger
void setEntityReplacementLogger(EntityReplacementLogger logger)
optionally inject a logger for recording replacements- Parameters:
logger-
-
hasReplacementEntities
boolean hasReplacementEntities(Class<?> entityType)
- Parameters:
entityType-- Returns:
- true if there are any entity replacements for classes of the specified type
-
hasReplacementEntity
boolean hasReplacementEntity(Class<?> entityType, Serializable id)
- Parameters:
entityType-id-- Returns:
- true if there is an entity replacement for a entity with the specified type and id
-
getReplacementEntityId
Serializable getReplacementEntityId(Class<?> entityType, Serializable id)
- Parameters:
entityType-id-- Returns:
- the replacement entity id for the target entity of specified type and id, or null if no replacement is needed
-
logReplacement
<T> T logReplacement(Class<T> type, Serializable id, Serializable replacementId, T originalEntity, T replacementEntity)
Log that replacement has occurred.- Parameters:
id-originalEntity-replacementEntity-
-
-