Class StringSubstitute


  • public final class StringSubstitute
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String substituteToLine​(java.lang.String line, java.util.Map<java.lang.String,​java.lang.Integer> parameters)
      Substitutes variables into a string.
      static java.util.List<java.lang.String> substituteToMultipleLines​(java.util.List<java.lang.String> lines, java.util.Map<java.lang.String,​java.lang.Integer> parameters)
      Substitutes variables into a list of strings.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StringSubstitute

        public StringSubstitute()
    • Method Detail

      • substituteToMultipleLines

        public static java.util.List<java.lang.String> substituteToMultipleLines​(java.util.List<java.lang.String> lines,
                                                                                 java.util.Map<java.lang.String,​java.lang.Integer> parameters)
        Substitutes variables into a list of strings.
        Parameters:
        lines - The list of strings.
        parameters - The parameters where the string represents the variable's identifier in the string list (without the curly brackets), and the integer represents the variable's value.
        Returns:
        List of strings where the variables are substituted.
      • substituteToLine

        public static java.lang.String substituteToLine​(java.lang.String line,
                                                        java.util.Map<java.lang.String,​java.lang.Integer> parameters)
        Substitutes variables into a string.
        Parameters:
        line - The string.
        parameters - The parameters where the string represents the variable's identifier in the string list (without the curly brackets), and the integer represents the variable's value.
        Returns:
        The string where the variables are substituted.