StaticgetGets the singleton instance of the class. If the class is not registered, it throws an error.
The type of the class.
The name of the class to get the singleton instance.
The singleton instance of the class.
StatichasChecks if the class is registered in the SingletonManager.
The name of the class to check if it is registered.
True if the class is registered, otherwise false.
StaticregisterRegisters a class instance in the SingletonManager.
The type of the class instance.
The name of the class.
The instance of the class to register as singleton.
Staticunregister
SingletonManager is a static class that manages the singletons in the application. When a class instance is registered, the SingletonManager stores it and returns the same instance when requested.
Example