Overview
Explore the Optional class in Java 8 through this comprehensive Devoxx conference talk. Dive into the history, rationale, and proper usage of Optional, a controversial and often misunderstood API. Learn about its narrow but frequent problem-solving purpose, common antipatterns, and code smells. Discover recommendations for effective implementation, including methods like findGet, isPresent, orElse, map, and filter. Examine static methods, new features, and real-world examples. Gain insights from Stuart Marks, a Principal Member of Technical Staff in Oracle's Java Platform Group, as he discusses Optional's evolution, its impact on Java development, and proposed improvements for Java 9. Understand the complexities surrounding Optional's serialization and field usage, and leave with a thorough understanding of this small but significant API.
Syllabus
Introduction
API without Optional
Optional
Find
Get
IsPresent
Optional Get
Optional Or Else
Optional Map
Chaining Methods
Filter Method
If Present
Static Methods
New Methods
Examples
Optional Methods
Optional History
Optional Serializable
Optional and Field
Summary Conclusion
Taught by
Devoxx