Class StringsHelper


  • public class StringsHelper
    extends Object
    • Constructor Detail

      • StringsHelper

        public StringsHelper()
    • Method Detail

      • wrapWithQuotesAndJoin

        public static String wrapWithQuotesAndJoin​(List<String> listOfStrings)
        Given a list of strings join all of them using quotes wrapping each item with quotes
        Parameters:
        listOfStrings - list of the strings
        Returns:
        output string
      • getStringsFromJoin

        public static List<String> getStringsFromJoin​(String joinedString)
        Given a string with joined items by comma, return a list of items. Each item will have replaced the double quoutes
        Parameters:
        joinedString - the joined string
        Returns:
        list of items
      • format

        public static String format​(String format,
                                    Map<String,​Object> values)
        Given a String and a map of key values, search in the string the variables using the ${xxx} format and replace by the correspondant value of the map Example: given: xxx${key1}yyy and "key1","000" the output will be xxx000yyy
        Parameters:
        format - input string with ${xxx} variables
        values - map with key values to replace in the string
        Returns:
        output string with the variables replaced