Tagged articles

Optional

104 articles · Page 2 of 2
Java Captain
Java Captain
Jan 5, 2019 · Fundamentals

Avoiding NullPointerException with the Null Object Pattern and Optional in Java

This article explains the "null‑check disaster" in Java, introduces the Null Object design pattern with full code examples, presents the NR Null Object IntelliJ plugin for automatic generation, and demonstrates how Java 8 Optional and Kotlin safe‑call operators can provide cleaner, null‑safe alternatives.

DesignPatternJavaNullObject
0 likes · 9 min read
Avoiding NullPointerException with the Null Object Pattern and Optional in Java
Liulishuo Tech Team
Liulishuo Tech Team
Apr 11, 2018 · Mobile Development

Understanding map, flatMap, and compactMap in Swift

This article explains the differences between map, flatMap, and compactMap in Swift, covering the three overloads of flatMap, their behavior with sequences and optionals, the rationale behind renaming one overload to compactMap, and when to prefer optional chaining versus optional mapping.

Functional ProgrammingOptionalSwift
0 likes · 8 min read
Understanding map, flatMap, and compactMap in Swift
Qunar Tech Salon
Qunar Tech Salon
Nov 21, 2014 · Backend Development

Using Guava to Avoid Null, Enforce Preconditions, and Simplify Optional, Ordering, and Throwables in Java

The article explains how Guava helps Java developers avoid null-related bugs, enforce method preconditions, replace cumbersome Object methods with utilities like Optional, Objects, and Ordering, and provides concise patterns for exception propagation using Throwables, all illustrated with clear code examples.

GuavaJavaOptional
0 likes · 18 min read
Using Guava to Avoid Null, Enforce Preconditions, and Simplify Optional, Ordering, and Throwables in Java