Package org.goplanit.demands
Class TravellerTypes
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<TravellerType>
-
- org.goplanit.demands.TravellerTypes
-
- All Implemented Interfaces:
Iterable<TravellerType>
,ManagedIdEntities<TravellerType>
,LongMapWrapper<TravellerType>
,MapWrapper<Long,TravellerType>
public class TravellerTypes extends ManagedIdEntitiesImpl<TravellerType> implements ManagedIdEntities<TravellerType>
Inner class to register and store traveler types- Author:
- markr
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description TravellerTypes(TravellerTypes other, boolean deepCopy, BiConsumer<TravellerType,TravellerType> mapper)
Copy constructorTravellerTypes(IdGroupingToken tokenId)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TravellerTypes
deepClone()
Deep clone implementationTravellerTypes
deepCloneWithMapping(BiConsumer<TravellerType,TravellerType> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapperTravellerType
getByXmlId(String xmlId)
Retrieve a TravelerType by its XML IdTravellerTypesFactory
getFactory()
Factory to create instance of managed id entity (for this container class)TravellerTypes
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
-
TravellerTypes
public TravellerTypes(IdGroupingToken tokenId)
Constructor- Parameters:
tokenId
- to use
-
TravellerTypes
public TravellerTypes(TravellerTypes other, boolean deepCopy, BiConsumer<TravellerType,TravellerType> mapper)
Copy constructor- Parameters:
other
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwisemapper
- to apply in case of deep copy to each original to copy combination (when provided, may be null)
-
-
Method Detail
-
getByXmlId
public TravellerType getByXmlId(String xmlId)
Retrieve a TravelerType by its XML IdThis method is not efficient, since it loops through all the registered traveler type in order to find the required entry.
- Parameters:
xmlId
- the XML Id of the specified traveler type- Returns:
- the retrieved traveler type, or null if no traveler type was found
-
getFactory
public TravellerTypesFactory getFactory()
Factory to create instance of managed id entity (for this container class)- Specified by:
getFactory
in interfaceManagedIdEntities<TravellerType>
- Returns:
- entity factory
-
shallowClone
public TravellerTypes 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<TravellerType>
- Specified by:
shallowClone
in interfaceMapWrapper<Long,TravellerType>
- Specified by:
shallowClone
in classManagedIdEntitiesImpl<TravellerType>
- Returns:
- copy
-
deepClone
public TravellerTypes deepClone()
Deep clone implementation- Specified by:
deepClone
in interfaceManagedIdEntities<TravellerType>
- Specified by:
deepClone
in classManagedIdEntitiesImpl<TravellerType>
- Returns:
- deep copy of entities
-
deepCloneWithMapping
public TravellerTypes deepCloneWithMapping(BiConsumer<TravellerType,TravellerType> mapper)
Deep clone implementation where the mapping for its internal copies is captured by the provided mapper- Specified by:
deepCloneWithMapping
in interfaceManagedIdEntities<TravellerType>
- Specified by:
deepCloneWithMapping
in classManagedIdEntitiesImpl<TravellerType>
- Parameters:
mapper
- to apply to each mapping between original and copy- Returns:
- copy
-
-