functionalj.stream.StreamPlusWithMapToMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalj-core Show documentation
Show all versions of functionalj-core Show documentation
The module for FunctionalJ Core.
package functionalj.stream;
import static functionalj.map.FuncMap.mapOf;
import java.util.function.Function;
import functionalj.map.FuncMap;
import functionalj.map.ImmutableMap;
public interface StreamPlusWithMapToMap {
public StreamPlus map(
Function super DATA, ? extends TARGET> mapper);
//== mapToMap ==
public default StreamPlus> mapToMap(
KEY key, Function super DATA, ? extends VALUE> mapper) {
return map(data -> mapOf(key, mapper.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5) {
return map(data -> ImmutableMap.of(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5,
KEY key6, Function super DATA, ? extends VALUE> mapper6) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data),
key6, mapper6.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5,
KEY key6, Function super DATA, ? extends VALUE> mapper6,
KEY key7, Function super DATA, ? extends VALUE> mapper7) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data),
key6, mapper6.apply(data),
key7, mapper7.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5,
KEY key6, Function super DATA, ? extends VALUE> mapper6,
KEY key7, Function super DATA, ? extends VALUE> mapper7,
KEY key8, Function super DATA, ? extends VALUE> mapper8) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data),
key6, mapper6.apply(data),
key7, mapper7.apply(data),
key8, mapper8.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5,
KEY key6, Function super DATA, ? extends VALUE> mapper6,
KEY key7, Function super DATA, ? extends VALUE> mapper7,
KEY key8, Function super DATA, ? extends VALUE> mapper8,
KEY key9, Function super DATA, ? extends VALUE> mapper9) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data),
key6, mapper6.apply(data),
key7, mapper7.apply(data),
key8, mapper8.apply(data),
key9, mapper9.apply(data)));
}
public default StreamPlus> mapToMap(
KEY key1, Function super DATA, ? extends VALUE> mapper1,
KEY key2, Function super DATA, ? extends VALUE> mapper2,
KEY key3, Function super DATA, ? extends VALUE> mapper3,
KEY key4, Function super DATA, ? extends VALUE> mapper4,
KEY key5, Function super DATA, ? extends VALUE> mapper5,
KEY key6, Function super DATA, ? extends VALUE> mapper6,
KEY key7, Function super DATA, ? extends VALUE> mapper7,
KEY key8, Function super DATA, ? extends VALUE> mapper8,
KEY key9, Function super DATA, ? extends VALUE> mapper9,
KEY key10, Function super DATA, ? extends VALUE> mapper10) {
return map(data -> mapOf(
key1, mapper1.apply(data),
key2, mapper2.apply(data),
key3, mapper3.apply(data),
key4, mapper4.apply(data),
key5, mapper5.apply(data),
key6, mapper6.apply(data),
key7, mapper7.apply(data),
key8, mapper8.apply(data),
key9, mapper9.apply(data),
key10, mapper10.apply(data)));
}
}