All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.basking2.sdsai.itrex.functions.PrintArgsFunction Maven / Gradle / Ivy

There is a newer version: 1.1.23
Show newest version
package com.github.basking2.sdsai.itrex.functions;

import com.github.basking2.sdsai.itrex.EvaluationContext;

import java.io.PrintStream;
import java.util.Iterator;

import static com.github.basking2.sdsai.itrex.iterators.Iterators.mapIterator;

public class PrintArgsFunction implements FunctionInterface> {
    final private PrintStream out;

    public PrintArgsFunction(PrintStream out) {
        this.out = out;
    };

    @Override
    public Iterator apply(final Iterator iterator, final EvaluationContext evaluationContext) {
        return mapIterator(iterator, arg -> {
            out.println(arg +":"+arg.getClass());
            return arg;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy