class Example {
public static void main(String[] args) {
var licenses = List.of(
new License(1, true),
new License(2, false),
new License(3, true)
);
var licenseMap = licenses.stream()
.collect(Collectors.toMap(License::getId, License::isActive));
}
@Getter
@RequiredArgsConstructor
private static class License {
private final Integer id;
private final boolean isActive;
}
}
public static void main(String[] args) {
var s1 = Stream.of(2, 1, 3); // Stream < Integer >
var s2 = s1.zip(List.of(7, 8, 9)); // Stream <Tuple2< Integer, Integer >>
var integers = s2.map(tuple2 -> tuple2._1 + tuple2._2).collect(Collectors.toList());
integers.forEach(System.out::println);
}
<a href="Controller?command=addtocart&name=${row.name}&price=${row.price}&time=${row.time}" class="button">Add to cart</a>
&name=${row.name}&price=${row.price}&time=${row.time}