I do not understand how to implement the Enum Version of the Singleton pattern. Below is an example of implementing "traditional" approach using the Singleton pattern. I would like to change it to use the Enum version but I am not sure how.
public class WirelessSensorFactory implements ISensorFactory{
private static WirelessSensorFactory wirelessSensorFactory;
//Private Const
private WirelessSensorFactory(){
System.out.println("WIRELESS SENSOR FACTORY");
}
public static WirelessSensorFactory getWirelessFactory(){
if(wirelessSensorFactory==null){
wirelessSensorFactory= new WirelessSensorFactory();
}
return wirelessSensorFactory;
}
}