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

functionalj.stream.StreamableWithMapToMap Maven / Gradle / Ivy

package functionalj.stream;

import java.util.function.Function;
import java.util.stream.Stream;

import functionalj.map.FuncMap;

public interface StreamableWithMapToMap {
    
    public  Streamable deriveWith(
            Function, Stream> action);
    
    
    //== mapToMap ==
    
    public default  Streamable> mapToMap(
            KEY key, Function mapper) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key, mapper);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5,
            KEY key6, Function mapper6) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5,
                              key6, mapper6);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5,
            KEY key6, Function mapper6,
            KEY key7, Function mapper7) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5,
                              key6, mapper6,
                              key7, mapper7);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5,
            KEY key6, Function mapper6,
            KEY key7, Function mapper7,
            KEY key8, Function mapper8) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5,
                              key6, mapper6,
                              key7, mapper7,
                              key8, mapper8);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5,
            KEY key6, Function mapper6,
            KEY key7, Function mapper7,
            KEY key8, Function mapper8,
            KEY key9, Function mapper9) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5,
                              key6, mapper6,
                              key7, mapper7,
                              key8, mapper8,
                              key9, mapper9);
        });
    }
    
    public default  Streamable> mapToMap(
            KEY key1, Function mapper1,
            KEY key2, Function mapper2,
            KEY key3, Function mapper3,
            KEY key4, Function mapper4,
            KEY key5, Function mapper5,
            KEY key6, Function mapper6,
            KEY key7, Function mapper7,
            KEY key8, Function mapper8,
            KEY key9, Function mapper9,
            KEY key10, Function mapper10) {
        return deriveWith(stream -> {
            return StreamPlus
                    .from    (stream)
                    .mapToMap(key1, mapper1,
                              key2, mapper2,
                              key3, mapper3,
                              key4, mapper4,
                              key5, mapper5,
                              key6, mapper6,
                              key7, mapper7,
                              key8, mapper8,
                              key9, mapper9,
                              key10, mapper10);
        });
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy