GenweiWu / Blog

个人技术能力提升
MIT License
4 stars 0 forks source link

apache commons #52

Open GenweiWu opened 6 years ago

GenweiWu commented 6 years ago

apache commons lang

https://commons.apache.org/proper/commons-lang/

GenweiWu commented 6 years ago

Java "模板字符串"

https://stackoverflow.com/a/3655963

Map<String, String> valuesMap = new HashMap<String, String>();
valuesMap.put("animal", "quick brown fox");
valuesMap.put("target", "lazy dog");
String templateString = "The ${animal} jumped over the ${target}.";
StrSubstitutor sub = new StrSubstitutor(valuesMap);
String resolvedString = sub.replace(templateString);
GenweiWu commented 5 years ago

MultiValuedMap

https://commons.apache.org/proper/commons-collections/apidocs/org/apache/commons/collections4/MultiValuedMap.html