title: How do I get all the instance variables of an object without using its getter methods?
body: <p>I have POJO class</p>
  
  <pre><code>Class Book {
  private String id;
  private String title;
  
  Public Book() {
  }
  
  //implement setter and getter
  ..............
  
  }
  
  main() {
  Book book = new Book();
  book.setId(1);
  book.setTitle("new moon");
  
  }
  </code></pre>
  
  <p>How to get all instance variable of book object
  I want the result become -> 1, "new moon" 
  without using the getter method, so I can convert the other POJO object.</p>
  
  <hr>
  
  <p>Clarification:</p>
  
  <p>I have 2 classes</p>
  
  <pre><code>Book {
  String id;
  String title;
  
  //constructor
  
  //setter
  }
  
  Student {
      String id;
      String name;
  
      //cuonstructor
  
      //setter
  }
  
  main() {
  Book book = new Book();
  book.setId(1);
  book.setTitle("new moon");
  
  Student student = new Student();
  student.setId(1);
  student.setName("andrew");
  
  //suppose i have BeanUtil object to get all instance varable value and class meta data
  BeanUtil.getMetadata(book, Book.class);
  //output is
  //id, title
  
  //suppose i have BeanUtil object to get all instance varable value and class meta data
  BeanUtil.getMetadata(student, Students.class);
  //output is
  //id, name
  
  BeanUtil.getInstanceVariableValue(student, Student.class);
  //output
  //1, andrew
  
  BeanUtil.getInstanceVariableValue(book, Book.class);
  //output
  //1, new moon
  }
  </code></pre>