title: How to use the "single-element enum type" to make this class a singleton?
body: <p>I have this class that I use as a singleton this way:</p>
  
  <pre><code>FlagOfficer.instance().someVariable
  </code></pre>
  
  <p>Here is the current implementation of the class:</p>
  
  <pre><code>public class FlagOfficer {
  
      public FlagOfficer() {
  
      }
  
      static FlagOfficer flagOfficer = null;
  
      public static FlagOfficer instance() {
          if (flagOfficer == null) {
              flagOfficer = new FlagOfficer();
          }
          return flagOfficer;
      }
  
      public boolean getLastBackupDate;
      public boolean syncProcessStartedOnce;
  }
  </code></pre>
  
  <p>I am right now reading the "Effective Java" book where they say the best way to implement the singleton pattern is to use single-element enum type</p>
  
  <p>Here is an example form the book:</p>
  
  <pre><code>public enum Elvis {
      INSTANCE;
      public void leaveTheBuilding() { ... }
  }
  </code></pre>
  
  <p>So how do I transform my class so that it uses this pattern? And how do I use it afterwards?</p>