title: Pass class's variable as argument
body: <p>I am working on Android Studio, and I want to accomplish the following:</p>
  
  <p>I have this class with some variables:</p>
  
  <pre><code>class test {
     private String prop1;
     private int prop2;
     private boolean prop3;
  }
  </code></pre>
  
  <p>I want to create a 'generic' method which can change some variable to a new value, like:</p>
  
  <pre><code>public changeVar(Variable var, Value val) {
      this.var = val;
  }
  </code></pre>
  
  <p>I was wondering if there is any clever way of doing that without the need to make tens of set methods for each variable.</p>
  
  <p>Thank you.</p>