Class EntityReplacementStrategyImpl
- java.lang.Object
-
- org.onebusaway.transit_data_federation.bundle.tasks.EntityReplacementStrategyImpl
-
- All Implemented Interfaces:
EntityReplacementStrategy
public class EntityReplacementStrategyImpl extends Object implements EntityReplacementStrategy
EntityReplacementStrategyimplementation that is used to map entity ids for a particular type.- Author:
- bdferris
- See Also:
EntityReplacementStrategy,EntityReplacementStrategyFactory
-
-
Constructor Summary
Constructors Constructor Description EntityReplacementStrategyImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEntityReplacement(Class<?> entityType, Serializable entityId, Serializable replacementEntityId)SerializablegetReplacementEntityId(Class<?> entityType, Serializable entityId)booleanhasReplacementEntities(Class<?> entityType)booleanhasReplacementEntity(Class<?> entityType, Serializable entityId)<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
public void setEntityReplacementLogger(EntityReplacementLogger logger)
Description copied from interface:EntityReplacementStrategyoptionally inject a logger for recording replacements- Specified by:
setEntityReplacementLoggerin interfaceEntityReplacementStrategy
-
addEntityReplacement
public void addEntityReplacement(Class<?> entityType, Serializable entityId, Serializable replacementEntityId)
-
hasReplacementEntities
public boolean hasReplacementEntities(Class<?> entityType)
- Specified by:
hasReplacementEntitiesin interfaceEntityReplacementStrategy- Returns:
- true if there are any entity replacements for classes of the specified type
-
hasReplacementEntity
public boolean hasReplacementEntity(Class<?> entityType, Serializable entityId)
- Specified by:
hasReplacementEntityin interfaceEntityReplacementStrategy- Returns:
- true if there is an entity replacement for a entity with the specified type and id
-
getReplacementEntityId
public Serializable getReplacementEntityId(Class<?> entityType, Serializable entityId)
- Specified by:
getReplacementEntityIdin interfaceEntityReplacementStrategy- Returns:
- the replacement entity id for the target entity of specified type and id, or null if no replacement is needed
-
logReplacement
public <T> T logReplacement(Class<T> type, Serializable id, Serializable replacementId, T originalEntity, T replacementEntity)
Description copied from interface:EntityReplacementStrategyLog that replacement has occurred.- Specified by:
logReplacementin interfaceEntityReplacementStrategy
-
-