3 ms·
"With" doesn't exist in Java, but it was introduced in C# 9.0 as part of the .NET implementation of records: https://devblogs.microsoft.com/dotnet/c-9-0-on-the
by giaour 5y ago
"With" doesn't exist in Java, but it was introduced in C# 9.0 as part of the .NET implementation of records:
https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#with-expressions https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#w...
I think the author is more saying that a "with" operator would fit into Java record semantics but might not be compatible with Lombok @Data classes or Kotlin data classes (though it looks from your link that Kotlin actually does have something very similar in the "copy" method).
- giaour 5y agoNot sure why this is getting downvoted; if you look at the hypothetical “with” syntax in the original blog post, it is clearly borrowed from the C# implementation.