Jimfs
record-builder
Jimfs | record-builder | |
---|---|---|
5 | 35 | |
2,380 | 650 | |
0.3% | - | |
8.5 | 7.3 | |
about 16 hours ago | 21 days 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.
Jimfs
-
How to write unit tests in C++ relying on non-code files?
Java has in-memory file systems that are essentially geared for this exact use case, eg jimfs[0]. You create your filesystem and any files you need when your tests are starting up, and your classes talk to them rather than the “real” ones. Maybe a similar project exists for the C++ ecosystem?
[0] https://github.com/google/jimfs
- An in-memory file system for Java
-
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.
Recently been using JIMFS. Made my tests much faster and cleaner!
- An in memory file system
-
Working and unit testing with temporary files in Java
I use Google's JIMFS "Just In Memory Filesystem" https://github.com/google/jimfs in my unit tests and have been very happy. No need to clean something up that disappears as soon as the test is over. Let's you create unix or windows style filesystems and I've used it to test a disk space healthcheck because you can set a limit to the size of the filesystem it creates. Very flexible and easy to use.
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.
What are some alternatives?
Modern Java - A Guide to Java 8 - Modern Java - A Guide to Java 8
MapStruct - An annotation processor for generating type-safe bean mappers
Lanterna - Java library for creating text-based GUIs
Lombok - Very spicy additions to the Java programming language.
OpenRefine - OpenRefine is a free, open source power tool for working with messy data and improving it
awesome-annotation-processing - A curated list of resources related to the Java annotation processing API (JSR 269)
Joda-Money - Java library to represent monetary amounts.
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...
LightAdmin - [PoC] Pluggable CRUD UI library for Java web applications
Immutables - Annotation processor to create immutable objects and builders. Feels like Guava's immutable collections but for regular value objects. JSON, Jackson, Gson, JAX-RS integrations included
Codename One - Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.
Jackson JSON Processor - Main Portal page for the Jackson project