I had a great pleasure to take part in the JAVIPS online 2020.
In one of my previous posts I was torturing Java™ Records using Lombok. After receiving some really encouraging comments (‘what a sick idea you have, respect!'), delivering a deep-dive talk "Java 15. What’s new and noteworthy", and some discussions on JVM Poland Slack channel, I’ve decided to keep torturing. Sorry ;-)
shebangin a way which makes it portable?
Some people find it shocking, that it’s possible these days to write a script (which will run in CLI) not only in Bash, Perl, Python or PHP, but also in Java.
The competition is over, the prizes are given away… And despite the trainings still going on, it might be time to show the answer to my little riddle, and make a comment on it.
When explaining Java records online I was asked several times ‘right, what about Lombok?’ In particular this question was ‘if the records are immutable, how are they different from Lombok’s
When Java 14 was (about to be) released I saw a few discussions following more or less this schema: - Oh, records in Java, cool, finally we have automatically generated setters and getters! - No, records in Java are POJOs without any setters… - Oh, I see… Cool, finally in Java we have generated Beans, without any setters though!
In the previous post I wrote how to make a record and what is actually the purpose of the records. In this entry I focus on the limitations and abilities of the records.
Java 14 introduced records as a preview feature. There was (is?) a decent amount of confusion, declarations and even heavy insults against ‘enemy’ libraries and IDE plugins. Let me take part in thi s, please.
In the chase for non-trivial examples to illustrate possible usage of JEP 305, some people might have gone too far, I guess. In particular into the more challenging area of the
equals()method, present in all Java objects.