I've updated JEP 401, formerly "Primitive Classes", now titled "Null-Restricted 
Value Object Storage". The purpose of this JEP is to allow for flattening of 
value objects in fields and arrays. This update gets there via two key features:

- "Optional" constructors, which express the capability of a value class to 
have instances created outside the normal construction process.

- Null-restricted types, which exclude null from the type's value set, and in 
the case of value classes with optional constructors, allow for a non-null 
default value.

There's more to say about nullness, which is covered by its own JEP that we're 
still working on. But the idea of null-restricted variables is enough to 
unblock progress on value object flattening. (Eventually, we envision—at least 
for now—delivering the two JEPs at the same time.)

The document is here:

https://openjdk.org/jeps/401

Reply via email to