~/talk

Do You Use the Optional Class as it Should Be

Talkat Devnexus 2020 · 2020-02-19..02-21· [java]
slides:none on file

Covers 25+ recipes for using java.util.Optional up to Java 12 with concrete code on GitHub, including stream integration and map vs flatMap patterns, and migration notes for Java 8–12. Demonstrates antipatterns: don’t use Optional as fields/constructor params/for collections, shows performance tradeoffs — Optional is ~4x heavier in memory than raw objects — and gives fixes: prefer orElseGet over orElse for expensive defaults, use OptionalInt/Long/Double, ifPresent, orElseThrow, flatMap, and optional streams.

AI-written summary · about

  1. 0:00Start
  2. 2:30Agenda
  3. 12:00How To Consume Optional Effectively
  4. 21:18Use Optional in Constructors
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.