title: Dynamic access of method based on external field in Spring boot
body: <p>We have multiple external variables in application.yml in spring boot application and i want to access this variable from my java code and based on the field value I want to redirect the call to various functions.</p>
  
  <p>Example:</p>
  
  <pre><code>String externalVariable1 abc;
  String externalVariable2 xyz;
  
  method: if(string == abc) {
  call function1; }
  else {
  call function2; }
  </code></pre>
  
  <p>Now problem here is there might be further addition to external variable in furture, I want to write robust method which should be adaptable to future addition to external variable without changing my core code. i might add the functionality as part of helper methods.</p>
  
  <p>All I can think of reflection way, Can you guys help me with better approach given i am using spring boot application.</p>