Avoiding Null Checks in Java 8 – Benjamin Winterberg

How to avoid null checks on getFoo().getBar().getBaz() chains even if you’re not using Java 8 Optional.

 

This post describes techniques how to prevent null checks and NullPointerExceptions in Java 8 in order to improve null safety and code readability.

Source: Avoiding Null Checks in Java 8 – Benjamin Winterberg

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s