Java Code Examples for com.googlecode.totallylazy.Sequence#contains()

The following examples show how to use com.googlecode.totallylazy.Sequence#contains() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestMethod.java    From yatspec with Apache License 2.0 5 votes vote down vote up
public static Status calculateStatus(final Sequence<Status> statuses) {
    if (statuses.contains(Status.Failed)) {
        return Status.Failed;
    }
    if (statuses.contains(Status.NotRun)) {
        return Status.NotRun;
    }
    return Status.Passed;
}
 
Example 2
Source File: ExpressionReader.java    From java-repl with Apache License 2.0 5 votes vote down vote up
public Option<String> readExpression() {
    Sequence<String> lines = Sequences.empty();

    do {
        lines = lines.append(lineReader.apply(lines));
    } while (!expressionIsTerminated(lines));

    return lines.contains(null)
            ? none(String.class)
            : some(lines.toString("\n").trim());
}
 
Example 3
Source File: ExpressionReader.java    From java-repl with Apache License 2.0 4 votes vote down vote up
private static boolean hasNullLine(Sequence<String> strings) {
    return strings.contains(null);
}