~/talk

API Design with Java 8 Lambdas and Streams

Talkat JavaOne 2015 · 2015-10-25..10-29· [java]
slides:none on file

Practical, example-driven rundown of how Java 8 actually reshapes APIs: shows adding ThreadLocal.withInitial instead of subclassing, the new Map.computeIfAbsent helper, and a small set of comparator factories and combinators (Comparator.comparing, thenComparing, nullsFirst/reversed) that avoid a combinatorial explosion. Covers Streams implementation details (Spliterator, StreamSupport, primitive streams) and when to return a Stream vs a Collection, plus concrete guidance on Optional (use only for method returns, not fields/params) and sensible uses of default methods.

AI-written summary · about

  1. 0:00Introduction
  2. 2:13Questions
  3. 2:56Designing API with Lambda Expressions
  4. 6:50How ThreadLocal works
  5. 8:16Multimap example
  6. 11:07Benefits of map
  7. 12:05Sort Methods
  8. 14:04Comparators
  9. 17:13Nulls
  10. 24:12Twitter Questions
  11. 26:51Streams API
  12. 29:08Collections vs Streams
  13. 32:33Return a Stream
  14. 33:59Convert Iterator to Stream
  15. 38:55Primitives
  16. 39:53Recap
  17. 45:25Optional
  18. 46:31Summary
  19. 48:54Optional Methods
  20. 51:17Optional Examples
  21. 51:55Where to Use Optional
  22. 55:21Code Smells
  23. 55:54Default Methods
  24. 57:44Default Method Example
  25. 58:13Other Use Cases
~/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.