title: Setting Empty String for Enum Value in Java
body: <p>I have an object in Java which I am trying to set from an enum class with following structure. </p>
  
  <pre><code>public enum Code {
      CODE_A,
      CODE_B,
      CODE_C,
      CODE_D,
      CODE_E,
      CODE_F,
      EMPTY("")
  }
  </code></pre>
  
  <p>Want to set my object to empty sting value. i.e. 
  <strong>Object.setCode(Code.EMPTY)</strong></p>
  
  <p>And when I look at my Object, it should have <strong>""</strong> instead of <strong>EMPTY</strong> as value for the property code. </p>
  
  <p>Can someone suggest what's a workaround I can use ? I don't want to modify the Object.setCode setter which is as below:</p>
  
  <pre><code>public void setCode(Code code) {
      this.code = code;
  }
  </code></pre>
  
  <p>Also the problem is Object.setCode(<strong>MustBe of Object-Code Type only</strong>)</p>