title: How to exclude class from YAML file?
body: <p>I use SnakeYAML to persist data into YAML file.</p>
  
  <pre><code>DumperOptions options = new DumperOptions();
  options.setPrettyFlow(true);
  options.setAllowReadOnlyProperties(true);
  Yaml yml = new Yaml(options);
  
  FileWriter writer = new FileWriter(path);
  yml.dump(object, writer);
  writer.flush();
  writer.close();
  </code></pre>
  
  <p>When I try to save the result, I get such content</p>
  
  <pre><code>!!com.test.yml.User
  users:
  - {
    name: Bob,
    age: 14
  }
  - {
    name: John,
    age: 15
  }
  </code></pre>
  
  <p>How can I avoid class <code>!!com.test.yml.User</code> from the file?</p>
  
  <p>Also I don't want to save null entities. For instance</p>
  
  <pre><code>- {
      name: null,
      age: 14
    }
  </code></pre>
  
  <p>should be </p>
  
  <pre><code>- {
      age: 14
    }
  </code></pre>