title: How to use pass enum to DTO
body: <p>I am passing a DTO whose one of the instance variable should be of type ENUM. However the enum is defined in another class, a class that creates the DTO.</p>
  
  <p>A short summary:</p>
  
  <pre><code>public class Node {
      Enum nodeType; &lt;--- should belong 
      Node (Enum nodeType) {
          this.nodeType = nodeType;
      }
  }
  
  
  public class CreateNode {
     Enum { TEXT_NODE, ATTR_NODE };
  
     Node returnNode() {
        // return node of Enum TEXT_NODE.
     } 
  
   }
  </code></pre>
  
  <p>Now,</p>
  
  <ol>
  <li><p>What should be done to share enum between CreateNode and Node ?</p></li>
  <li><p>How should the "recipient" of Node receive the node with one of the type as enum ?</p></li>
  </ol>