record-builder
awesome-annotation-processing
record-builder | awesome-annotation-processing | |
---|---|---|
36 | 5 | |
809 | 511 | |
2.3% | 2.2% | |
6.3 | 3.7 | |
6 days ago | 5 months ago | |
Java | ||
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
record-builder
- JEP Draft: Prepare to Make Final Mean Final
-
JEP Draft – Derived Record Creation (Preview) – Java
The problem with this approach is that the people will have to build crutches like https://github.com/Randgalt/record-builder and by the time Java adds missing features all the codebases will be forever polluted with legacy workarounds that nobody will dare to remove because of backwards compatibility.
It also hinders adoption of new features as people will prefer to maintain consistency in their codebases.
-
Any library you would like to recommend to others as it helps you a lot? For me, mapstruct is one of them. Hopefully I would hear some other nice libraries I never try.
Record builder is pretty good for making builders for your Java 17 records
-
Useful & Unknown Java Libraries - Piotr's TechBlog
I always have to bring up RecordBuilder simply because of the included Withers and it being a source generator instead of the Lombok weirdness.
-
How to use Java Records
The above is not particularly user-friendly. Luckily compiler plugins can provide the missing feature, most notably RecordBuilder:
-
Named Parameters in Java
For records, instead of lombok you can use https://github.com/Randgalt/record-builder which is a valid annotation processor and will not break on JDK changes
-
has anyone written custom annotations using Lombok ?
In this particular case you can generate the builder with something like https://github.com/Randgalt/record-builder that is both valid java and lombok-like enough
-
I made a java client for the todoist api
Records + Record Builder or immutables + the trick to hide the implementing class w/sealed are your friend. Both the mutability and naming conventions this generates are vomitus.
-
"With" for records -- Brian Goetz
Did you use https://github.com/Randgalt/record-builder ?
-
What's your top Java pet peeve?
Try my annotation processor. It generates withers. https://github.com/Randgalt/record-builder
awesome-annotation-processing
-
Proposal to change default annotation processing policy in JDK 23
- Checker Framework
There's quite a list here https://github.com/gunnarmorling/awesome-annotation-processi... (Though I don't think Error Prone is actually an annotation processor, but rather a javac plugin.)
There's some irony in that Immutables and Autovalue are often named as alternatives for people that dislike Lombok's implementation but do like (some of) Lombok's features.
-
Monkey-patching in Java
The documentation could be less sparse. I found the following Awesome Java Annotation Processing. Here's a simplified class diagram to get you started:
-
A Java library to add compile-time validation for any annotation
Nice! I suggest having it added to Gunnar's awesome annotation processing list
-
Is using Project Lombok actually an good idea?
Lombok is not Java. Unlike, say, Immutables, Auto and other annotation processors, it is not some supported add-on, but a piece of software that significantly modifies how the javac compiler works. It is essentially and technically a fork of javac, and, therefore a different language from Java.
- Is Lombok in danger of becoming incompatible with future JDK's?
What are some alternatives?
MapStruct - An annotation processor for generating type-safe bean mappers
equalsverifier - EqualsVerifier can be used in Java unit tests to verify whether the contract for the equals and hashCode methods is met.
core - An advanced and highly optimized Java library to build frameworks: it's useful for scanning class paths, generating classes at runtime, facilitating the use of reflection, scanning the filesystem, executing stringified source code and much more...
twitter4s - An asynchronous non-blocking Scala client for both the Twitter Rest and Streaming API
javageci - Java Code Generation Framework
annotation-constraints