I am using an enum singletom pattern like this:
public enum LicenseLoader implements ClientLicense {
INSTANCE;
/**
* @return an instance of ClientLicense
*/
public static ClientLicense getInstance() {
return (ClientLicense)INSTANCE;
}
...rest of code
}
Now I want to return the Interface and hide the fact that we are actually using an enum at all. I want the client to use getInstance() and not LicenseLoader.INSTANCE as one day I may decide to use a different pattern if necessary.
Is is possible to make INSTANCE private to the enum?