record-builder
Immutables
record-builder | Immutables | |
---|---|---|
35 | 6 | |
762 | 3,440 | |
- | 0.2% | |
6.3 | 4.3 | |
12 days ago | about 2 months ago | |
Java | Java | |
Apache License 2.0 | Apache License 2.0 |
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 – 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
-
Stay with Java(+Spring) or pivot towards Go/Python?
I personally don't use that one much, but you could use this library instead.
Immutables
-
Unchecked Java: Say Goodbye to Checked Exceptions Forever
This is every Lombok lover's favorite strawman argument I've run into.
I've been coding in Java professionally for ~20 years. I can count with zero hands the number of times I've been burned by a getter or setter getting changed into something surprising.
If you really need auto-generated getters/setters/builders - Immutables [1] is a library that does it using bog standard annotation processing rules that don't require hacking your build process.
[1] https://github.com/immutables/immutables
-
[ANN] RecordBuilder v33 Released
https://github.com/immutables/immutables/issues/1358 https://bugs.openjdk.java.net/browse/JDK-8281238
-
ExpressiveJava: Re-implementing a simple Scala interpreter in JDK 8/15/17. JDK 17 code nearly identical with use of Records + Pattern Matching + Sealed Types.
That's good, but I prefer this : https://github.com/immutables/immutables It has all sorts of neat stuff like lazy, defered, cached, defaults etc. Just needs updating to use records.
-
Stop using noargsconstructors and setters (and builders)
Not bad :) I like using Immutables (which is backed by the style of implementation referenced in the link in https://github.com/immutables/immutables/issues/450)
-
If you could change one thing in the Java and one thing in the JVM, what would you change?
Annotation processors? Like Immutables? Those already exists, but the major difference is that an annotation processor cannot change the processed class, but has to create another one.
-
Popular technologies for a full-stack Java developer
While you’re looking into this I would highly recommend checking out immutables. https://github.com/immutables/immutables It is pretty popular in the industry and very nice!
What are some alternatives?
MapStruct - An annotation processor for generating type-safe bean mappers
Lombok - Very spicy additions to the Java programming language.
Auto - A collection of source code generators for Java.
awesome-annotation-processing - A curated list of resources related to the Java annotation processing API (JSR 269)
AspectJ
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...
jsonschema2pojo - Generate Java types from JSON or JSON Schema and annotate those types for data-binding with Jackson, Gson, etc
Jackson JSON Processor - Main Portal page for the Jackson project
Spring Loaded - Java agent that enables class reloading in a running JVM
javageci - Java Code Generation Framework
JHipster - JHipster, much like Spring initializr, is a generator to create a boilerplate backend application, but also with an integrated front end implementation in React, Vue or Angular. In their own words, it "Is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures."