title: Singleton Pattern: Using Enum Version
body: <p>I do not understand how to implement the <code>Enum</code> Version of the <code>Singleton</code> 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.</p>
  
  <pre><code>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;
      }
  
  }
  </code></pre>