title: Replace field value(s) in a String
body: <p>Using Google Guava is there String utility to easily replace string field inside like this:</p>
  
  <pre><code>String query = mydb..sp_mySP ${userId}, ${groupId}, ${someOtherField}
  </code></pre>
  
  <p>Where I can do something like this:</p>
  
  <pre><code>StringUtil.setString(query)
     .setField("userId", "123")
     .setField("groupId", "456")
     .setField("someOtherField", "12-12-12");
  </code></pre>
  
  <p>Then the resulting String would be:</p>
  
  <pre><code>mydb..sp_mySP 123, 456, 12-12-12
  </code></pre>
  
  <p>Of course, setting the String field patter like <code>${&lt;field&gt;}</code> before the operation...</p>
  
  <p>Anyway, this is my approach:</p>
  
  <pre><code>public class StringUtil {
      public class FieldModifier {
          private String s;
          public FieldModifier(String s){
              this.s = s;
          }
          public FieldModifier setField(String fieldName, Object fieldValue){
              String value = String.valueOf(fieldValue);
              s = modifyField(s, fieldName, value);
              return new FieldModifier(s); 
          }
          public String get() {
                  return s;
          }
          private String modifyField(String s, String fieldName, String fieldValue){
              String modified = "";
              return modified;
          }
      }
      public FieldModifier parse(String s){
          FieldModifier fm = new FieldModifier(s);
          return fm; 
      }
  }
  </code></pre>
  
  <p>So in this case, I just need to put the actual code in the <code>modifyField</code> function that will modify the string in a straightforward way. Also if there's a way so the <code>parse</code> function be static so I can just do <code>StringUtil.parse(...)</code> without doing <code>new StringUtil().parse(...)</code> which really doesn't look good.</p>