title: How to rewrite this Java class to a Kotlin data class?
body: <p>I have this in Java : </p>
  
  <pre><code>public class User {
  
      String name;
      String id;
      int age;
  
      public User(String name) {
          this.name = name;
      }
  
      public User(String name, String id) {
          this.name = name;
          this.id = id;
      }
  
      public User(String id, int age) {
          this.id = id;
          this.age = age;
      }
  
      public User() {
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public int getAge() {
          return age;
      }
  
      public void setAge(int age) {
          this.age = age;
      }
  
      @Override
      public String toString() {
          return "User{" +
                  "name='" + name + '\'' +
                  ", id='" + id + '\'' +
                  ", age=" + age +
                  '}';
      }
  } 
  </code></pre>
  
  <p>In a Kotlin class its something like this :</p>
  
  <pre><code>class User {
  
      var name: String?=null
      var id: String?=null
      var age: Int = 0
  
      constructor(name: String) {
          this.name = name
      }
  
      constructor(name: String, id: String) {
          this.name = name
          this.id = id
      }
  
      constructor(id: String, age: Int) {
          this.id = id
          this.age = age
      }
  
      constructor() {}
  
      override fun toString(): String {
          return "User{" +
                  "name='" + name + '\'' +
                  ", id='" + id + '\'' +
                  ", age=" + age +
                  '}'
      }
  }
  </code></pre>
  
  <p>What I need to know, is how to do that in a data class with the 4 different constructors and the setters and getters</p>