Hi,
This is what Factory
Pattern is all about.
Where in for some reason you as the writer of the class do not want the user classes to instantiate objects of your class directly. Hence you ask the users of your class to call a static method defined within your class which in turn may do some validation and then may return a new object of your class or may return a reference to singleton.
Example code for plain factory pattern:
Example code for singleton factory pattern:
Factory pattern can be taken further to achieve the following: