com.appfoundation.automation.util
Class VariableUtils

java.lang.Object
  extended by com.appfoundation.automation.util.VariableUtils

public class VariableUtils
extends java.lang.Object

Utility class for dealing with runtime varaible replacement in text.

Author:
john.valentino

Constructor Summary
VariableUtils()
           
 
Method Summary
static java.lang.String replace(java.lang.String text, java.util.Map<java.lang.String,Variable> variables)
          Updates the given text with any values that correspond to variables in that text in the format of "my string has {my_var} here" where {my_var} is a variable.
static java.lang.String replace(java.lang.String text, java.lang.String name, java.lang.String value)
          Replaces the a value in the given text using a variable name in the format {foo}
static java.lang.String replaceByIndex(java.lang.String text, java.lang.String[] args)
          Does a replace of things formatted by index like {0}, {1} starting at 0, in order of the given args.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VariableUtils

public VariableUtils()
Method Detail

replace

public static java.lang.String replace(java.lang.String text,
                                       java.lang.String name,
                                       java.lang.String value)
Replaces the a value in the given text using a variable name in the format {foo}

Parameters:
text -
name -
value -
Returns:

replace

public static java.lang.String replace(java.lang.String text,
                                       java.util.Map<java.lang.String,Variable> variables)
Updates the given text with any values that correspond to variables in that text in the format of "my string has {my_var} here" where {my_var} is a variable.

Parameters:
text -
variables -
Returns:

replaceByIndex

public static java.lang.String replaceByIndex(java.lang.String text,
                                              java.lang.String[] args)
Does a replace of things formatted by index like {0}, {1} starting at 0, in order of the given args.

Parameters:
text -
args -
Returns: