<?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://foojay.io/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://foojay.io/today/author/don-raab/index.xml" rel="self" type="application/rss+xml"/><item><title>Immutable Collections in Java with Sealed Types</title><link>https://foojay.io/today/immutable-collections-in-java-with-sealed-types/</link><pubDate>Thu, 10 Dec 2020 03:02:00 +0000</pubDate><guid>https://foojay.io/today/immutable-collections-in-java-with-sealed-types/</guid><description>&lt;figure class="size-medium"&gt;&#10; &lt;img src="https://foojay.io/today/immutable-collections-in-java-with-sealed-types/foojay-don-1-1-469x510.jpg" alt="" width="469" height="510" loading="lazy" class="is-zoomable"&gt;&lt;/figure&gt;&#10;&#10;&lt;p&gt;&lt;em&gt;Designing Immutable Collection using Sealed Types in JDK 15&lt;/em&gt;&lt;/p&gt;&#10;&lt;p&gt;How to define contractual, structural, and verifiable immutable Java collections.&lt;/p&gt;&#10;&lt;h2 id="introducing-sealed-types"&gt;Introducing Sealed Types&lt;/h2&gt;&#10;&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.&lt;/p&gt;</description></item></channel></rss>