Package org.goplanit.mode
Class ModesImpl
- java.lang.Object
-
- org.goplanit.utils.wrapper.MapWrapperImpl<Long,V>
-
- org.goplanit.utils.wrapper.LongMapWrapperImpl<E>
-
- org.goplanit.utils.id.ManagedIdEntitiesImpl<Mode>
-
- org.goplanit.mode.ModesImpl
-
- All Implemented Interfaces:
Cloneable,Iterable<Mode>,ManagedIdEntities<Mode>,Modes,LongMapWrapper<Mode>,MapWrapper<Long,Mode>
public class ModesImpl extends ManagedIdEntitiesImpl<Mode> implements Modes
Implementation of the Modes interface to create and register modes- Author:
- mark
-
-
Field Summary
-
Fields inherited from class org.goplanit.utils.id.ManagedIdEntitiesImpl
managedIdClass
-
-
Constructor Summary
Constructors Constructor Description ModesImpl(ModesImpl modesImpl)Copy ConstructorModesImpl(IdGroupingToken groupId)ConstructorModesImpl(ModeFactory modeFactory)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ModesImplclone()Each map wrapper should be cloneable where the contents are references of the original where possible but the underlying map itself is newly createdbooleancontainsPredefinedMode(PredefinedModeType modeType)verify if predefined mode is registeredPredefinedModeget(PredefinedModeType modeType)get predefined mode if it is registeredModegetByXmlId(String xmlId)Retrieve a Mode by its XML IdModeFactorygetFactory()Collect the mode factory to use for creating instances-
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, contains, createEmptyInstance, findFirst, get, getKeyByValue, getMap, getValueToKey, isEmpty, iterator, register, remove, setMap, size, toCollection, valuesAsNewSet
-
Methods inherited from class java.lang.Object
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, recreateIds, recreateIds, reset
-
Methods inherited from interface org.goplanit.utils.wrapper.MapWrapper
addAll, clear, contains, findFirst, forEachIn, get, getFirst, getKeyByValue, isEmpty, register, remove, size, toCollection, valuesAsNewSet
-
-
-
-
Constructor Detail
-
ModesImpl
public ModesImpl(IdGroupingToken groupId)
Constructor- Parameters:
groupId- to use for creating ids for instances
-
ModesImpl
public ModesImpl(ModeFactory modeFactory)
Constructor- Parameters:
modeFactory- factory to use
-
ModesImpl
public ModesImpl(ModesImpl modesImpl)
Copy Constructor- Parameters:
modesImpl- to copy
-
-
Method Detail
-
containsPredefinedMode
public boolean containsPredefinedMode(PredefinedModeType modeType)
verify if predefined mode is registered- Specified by:
containsPredefinedModein interfaceModes- Parameters:
modeType- to verify- Returns:
- true when available, false otherwise
-
get
public PredefinedMode get(PredefinedModeType modeType)
get predefined mode if it is registered
-
getByXmlId
public Mode getByXmlId(String xmlId)
Retrieve a Mode by its XML Id- Specified by:
getByXmlIdin interfaceModes- Parameters:
xmlId- the XML Id of the specified mode- Returns:
- the retrieved mode, or null if no mode was found
-
clone
public ModesImpl clone()
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:
clonein interfaceManagedIdEntities<Mode>- Specified by:
clonein interfaceMapWrapper<Long,Mode>- Specified by:
clonein interfaceModes- Specified by:
clonein classManagedIdEntitiesImpl<Mode>- Returns:
- copy
-
getFactory
public ModeFactory getFactory()
Collect the mode factory to use for creating instances- Specified by:
getFactoryin interfaceManagedIdEntities<Mode>- Specified by:
getFactoryin interfaceModes- Returns:
- modeFactory to create modes for this container
-
-