Package org.goplanit.service.routed
Class RoutedModeServicesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<RoutedService>
-
- org.goplanit.service.routed.RoutedModeServicesImpl
-
- All Implemented Interfaces:
Iterable<RoutedService>
,ManagedIdEntities<RoutedService>
,RoutedModeServices
,LongMapWrapper<RoutedService>
,MapWrapper<Long,RoutedService>
public class RoutedModeServicesImpl extends ManagedIdEntitiesImpl<RoutedService> implements RoutedModeServices
Implementation of the RoutedModeServices interface- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description RoutedModeServicesImpl(RoutedModeServicesImpl routedModeServicesImpl, boolean deepCopy, BiConsumer<RoutedService,RoutedService> mapper)
Copy constructor, also creates new factory with this as its underlying containerRoutedModeServicesImpl(IdGroupingToken tokenId, Mode supportedMode)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RoutedModeServicesImpl
deepClone()
Deep clone implementationRoutedModeServicesImpl
deepCloneWithMapping(BiConsumer<RoutedService,RoutedService> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperRoutedServiceFactoryImpl
getFactory()
Factory to create instance of managed id entity (for this container class)Mode
getMode()
The supported mode for the routed services registeredRoutedModeServicesImpl
shallowClone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created-
Methods inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
getManagedIdClass, recreateIds, reset, updateIdMapping
-
Methods inherited from class org.goplanit.utils.wrapper.LongMapWrapperImpl
containsKey, get, remove
-
Methods inherited from class org.goplanit.utils.wrapper.MapWrapperImpl
clear, containsValue, createEmptyInstance, firstMatch, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, removeIf, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface org.goplanit.utils.wrapper.LongMapWrapper
get, remove
-
Methods inherited from interface org.goplanit.utils.id.ManagedIdEntities
containsKey, getManagedIdClass, groupBy, recreateIds, recreateIds, reset, streamSortedBy
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, containsValue, firstMatch, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, removeAll, removeIf, size, stream, streamSorted, toCollection, toMap, valuesAsNewSet
-
-
-
-
Constructor Detail
-
RoutedModeServicesImpl
public RoutedModeServicesImpl(IdGroupingToken tokenId, Mode supportedMode)
Constructor- Parameters:
tokenId
- to use for id generationsupportedMode
- mode all routed services adhere to
-
RoutedModeServicesImpl
public RoutedModeServicesImpl(RoutedModeServicesImpl routedModeServicesImpl, boolean deepCopy, BiConsumer<RoutedService,RoutedService> mapper)
Copy constructor, also creates new factory with this as its underlying container- Parameters:
routedModeServicesImpl
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisemapper
- to use for tracking mapping between original and copied entity (may be null)
-
-
Method Detail
-
getFactory
public RoutedServiceFactoryImpl getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactory
in interfaceManagedIdEntities<RoutedService>
- Specified by:
getFactory
in interfaceRoutedModeServices
- Returns:
- entity factory
-
getMode
public final Mode getMode()
The supported mode for the routed services registered- Specified by:
getMode
in interfaceRoutedModeServices
- Returns:
- supported mode
-
shallowClone
public RoutedModeServicesImpl shallowClone()
Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly created- Specified by:
shallowClone
in interfaceManagedIdEntities<RoutedService>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,RoutedService>
- Specified by:
shallowClone
in interfaceRoutedModeServices
- Specified by:
shallowClone
in classManagedIdEntitiesImpl<RoutedService>
- Returns:
- copy
-
deepClone
public RoutedModeServicesImpl deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceManagedIdEntities<RoutedService>
- Specified by:
deepClone
in interfaceRoutedModeServices
- Specified by:
deepClone
in classManagedIdEntitiesImpl<RoutedService>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public RoutedModeServicesImpl deepCloneWithMapping(BiConsumer<RoutedService,RoutedService> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<RoutedService>
- Specified by:
deepCloneWithMapping
in interfaceRoutedModeServices
- Specified by:
deepCloneWithMapping
in classManagedIdEntitiesImpl<RoutedService>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-