List of usage examples for java.util.stream Collectors joining
public static Collector<CharSequence, ?, String> joining(CharSequence delimiter)
From source file:com.zestedesavoir.zestwriter.utils.Configuration.java
/** * Add new content config files/*from w ww .jav a 2 s .c o m*/ * @param projectFileName file path of content you want to add */ public void addActionProject(String projectFileName) { List<String> existing = getActions(); List<String> recent = new ArrayList<>(existing); if (recent.contains(projectFileName)) { recent.remove(projectFileName); } recent.add(0, projectFileName); actions.put(ActionData.LAST_PROJECTS.getKey(), recent.stream().limit(5).map(Object::toString).collect(Collectors.joining(","))); saveActionFile(); }