jaskell.parsec.common.JoinText Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jaskell-java8 Show documentation
Show all versions of jaskell-java8 Show documentation
This is a utils library for java 8 project.
It include parsec combinators and sql generators library.
package jaskell.parsec.common;
import static java.util.stream.Collectors.joining;
import java.util.List;
import java.util.stream.Collector;
/**
* Created by Mars Liu on 16/9/13.
* JoinText is a binder. It join Character List to String.
*/
public class JoinText
implements Binder, String> {
private final String sep;
@Override
public Parsec bind(List value) {
Collector j = sep == null ? joining() : joining(sep);
return state -> value.stream().map(Object::toString).collect(j);
}
public JoinText() {
sep = null;
}
public JoinText(String sep) {
this.sep = sep;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy