title: Abstract function to access field in Java
body: <p>Please allow me to apologize for the poor language in which I am describing the problem ... I simply don't know exactly how to phrase it best.  Does <code>MethodWhichPointsToOneOfTheMembersOfBla</code> exist and how can it be built?</p>
  
  <pre><code>public class Bla {
  
      public Integer bla1;
      public Integer bla2;
  
      // some methods
  
  }
  
  public class SomeClass {
  
      private Bla bla = new Bla();
  
      private MethodWhichPointsToOneOfTheMembersOfBla mwpt = new MethodWhichPointsToField(2); // or 1
  
      public setBla(Integer i) {
          mwpt(bla).set(i);
      }
  
      public Integer getBla() {
          return mwpt(bla).get();
      }
  
  }
  </code></pre>
  
  <p>Please note that <strong>do not</strong> want to <strong>use</strong> a <code>switch</code> inside of <code>setBla</code>.</p>
  
  <p>E.g., is there some form of abstract method which I could initialize to always point to the second field in <code>Bla</code>.</p>