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

functionalj.stream.IntStreamProcessor Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
package functionalj.stream;

import static functionalj.lens.Access.theInteger;

import java.util.function.ToIntFunction;

import lombok.val;

public interface IntStreamProcessor {
    
    public TARGET process(IntStreamPlus stream);
    
    
    default StreamProcessor ofInteger() {
        return of(theInteger);
    }
    default  StreamProcessor of(ToIntFunction mapper) {
        return new StreamProcessor() {
            @Override
            public TARGET process(StreamPlus stream) {
                val dataStream = stream.mapToInt(mapper);
                val target     = IntStreamProcessor.this.process(dataStream);
                return target;
            }
        };
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy