<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Don Raab on foojay.io - Friends of OpenJDK</title><link>https://foojayio.github.io/website/today/author/don-raab/</link><description>Articles written by Don Raab on foojay.io - Friends of OpenJDK</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Thu, 10 Dec 2020 03:02:00 +0000</lastBuildDate><atom:link href="https://foojayio.github.io/website/today/author/don-raab/index.xml" rel="self" type="application/rss+xml"/><item><title>Immutable Collections in Java with Sealed Types</title><link>https://foojayio.github.io/website/today/immutable-collections-in-java-with-sealed-types/</link><pubDate>Thu, 10 Dec 2020 03:02:00 +0000</pubDate><guid>https://foojayio.github.io/website/today/immutable-collections-in-java-with-sealed-types/</guid><description>&lt;br /&gt;
&lt;img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-36538" class="size-medium wp-image-36538" src="foojay-don-1-1-469x510.png" alt="" width="469" height="510"&gt;
&lt;p&gt;&lt;em&gt;Designing Immutable Collection using Sealed Types in JDK 15&lt;/em&gt;{#caption-attachment-36538}&lt;/p&gt;
&lt;br /&gt;
&lt;p&gt;How to define contractual, structural, and verifiable immutable Java collections.&lt;/p&gt;
&lt;h2 id="9dc0"&gt;Introducing Sealed Types&lt;/h2&gt;
&lt;p&gt;JDK 15 was released on September 15, 2020. &lt;a href="https://openjdk.java.net/jeps/360" target="_blank" rel="noopener noreferrer"&gt;JEP 360&lt;/a&gt;
Sealed Types was included as a preview feature in this release, with its second preview in JDK 16. Sealed Types is part of &lt;a href="https://openjdk.java.net/projects/amber/" target="_blank" rel="noopener noreferrer"&gt;Project Amber&lt;/a&gt;
. Sealed classes or interfaces can be used to restrict the interfaces or classes that are allowed to extend them. This is accomplished by using the &lt;code&gt;sealed&lt;/code&gt;, &lt;code&gt;non-sealed&lt;/code&gt;, and &lt;code&gt;permits&lt;/code&gt; modifiers.{#297e}&lt;/p&gt;</description></item></channel></rss>