Package com.oceanprotocol.squid.helpers
Class StringsHelper
- java.lang.Object
-
- com.oceanprotocol.squid.helpers.StringsHelper
-
public class StringsHelper extends Object
-
-
Constructor Summary
Constructors Constructor Description StringsHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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 xxx000yyystatic List<String>
getStringsFromJoin(String joinedString)
Given a string with joined items by comma, return a list of items.static String
wrapWithQuotesAndJoin(List<String> listOfStrings)
Given a list of strings join all of them using quotes wrapping each item with quotes
-
-
-
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} variablesvalues
- map with key values to replace in the string- Returns:
- output string with the variables replaced
-
-