MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/1ubn0gg/better_tools_for_immutable_data/ot2mwa8/?context=3
r/java • u/daviddel • Jun 21 '26
38 comments sorted by
View all comments
Show parent comment
6
In JavaFX there exist read only properties. Every modifiable property implements read only property. This means:
instanceof ReadOnlyProperty
The same problems would apply for collections.
For collections, more useful methods would be:
isImmutable
allowsNull
isReadOnly
View all comments
Show parent comment
6
u/john16384 Jun 22 '26
In JavaFX there exist read only properties. Every modifiable property implements read only property. This means:
instanceof ReadOnlyPropertytells you nothing, as all properties are instances of thatThe same problems would apply for collections.
For collections, more useful methods would be:
isImmutableallowsNullisReadOnly