diff --git a/slides.md b/slides.md index 3fdb960..623c1e8 100644 --- a/slides.md +++ b/slides.md @@ -2,7 +2,8 @@ marp: true title: Una mirada funciona a Java 21 theme: gaia -footer: #Commitconf 2024 +footer: #commitconf 2024 +author: Antonio Muñoz color: #fff transition: fade-out backgroundImage: url('https://cdn.wallpapersafari.com/97/99/MnWulT.jpg') @@ -142,7 +143,7 @@ public sealed interface Tree { record Node(String value, Tree left, Tree right) implements Tree { } record Leaf(String value) implements Tree {} -} +} ``` --- @@ -155,7 +156,7 @@ public sealed interface Optional { record Empty() implements Optional { } record Present(T value) implements Optional {} -} +} ``` --- @@ -236,9 +237,9 @@ * AKA withers. ```java -Point newPoint = oldPoint with { - x *= 2; - y *= 2; +Point newPoint = oldPoint with { + x *= 2; + y *= 2; }; ``` @@ -251,6 +252,13 @@ * Mejora para pattern matching. * Cualquier clase. +```java +var result = switch (optional) { + case Optional.of(var value) -> value.toString(); + case Optional.empty() -> "empty"; +}; +``` + --- # ¿Qué falta todavía?