Use this tag for questions relating to the Immutables Library for Java.
Questions tagged [immutables-library]
99 questions
0
votes
1 answer
How do I set up APT for Immutables such that Intellij Idea will recognize the generated code?
I'm looking into migrating from maven to gradle, in this case, gradle itself seems to be working fine, but Idea isn't recognizing the source code that Immutables is generating.
I've read this blog post on APT, it's how I got this for.
/*
* This…

xenoterracide
- 16,274
- 24
- 118
- 243
0
votes
1 answer
Fatal error applying Proguard to Retrofit2 and GSONAdapters
I am trying to setup proguard on my app and I'm encountering the following error:
java.lang.NoSuchMethodError: No static method getParameterized(Ljava/lang/reflect/Type;[Ljava/lang/reflect/Type;)Lcom/google/gson/reflect/TypeToken; in class…

mitenko
- 491
- 1
- 5
- 13
0
votes
1 answer
Creating a TreeMultimap with Immutable object
I am currently using immutables to construct concrete objects.
I am facing an issue while trying to create a TreeMultiMap.
ERROR: It is expecting a comparable in the OrderKey to create the map,
How do I set the comparator with immutables to create a…

serah
- 2,057
- 7
- 36
- 56
0
votes
1 answer
Injection via Guice into an Immutables class
I'm using 2 common packages, Immutables and
Guice. The very first thing that happens at runtime is I load setting from environment and other sources into settings into a singleton, non-Immutable config class, let's call it MyConfig, that for…

Ray
- 40,256
- 21
- 101
- 138
0
votes
1 answer
How to prevent IntelliJ from removing classes compiled from generated sources when running tests?
The default config for JUnit tests in IntelliJ (v2016.3) is to run Build before launch. Normally, this is a good thing as it ensures that all of the changes have been applied before running the tests. However, it seems to be deleting the compiled…

cdeszaq
- 30,869
- 25
- 117
- 173
0
votes
1 answer
Adding an element to a Java immutable queue
I hope that someone can help me with my little problem.
I defined my EmptyQueue and my NotEmptyQueue in this way, following my interface Immutable queue. The main problem it's that the method enQueue, that should add an element to myQueue is not…

Nikita
- 3
- 3
0
votes
1 answer
How to make Immutables library skip serializing Optional fields
I am working with Immutables library (https://immutables.github.io). I need my classes to serialize to JSON (I use Jackson). I want to skip Optional fields in my output JSON. Before Immutables, I provided @JsonInclude(JsonInclude.Include.NON_EMPTY)…

Bartosz Bilicki
- 12,599
- 13
- 71
- 113
-1
votes
0 answers
Interfaces vs abstract classes for immutable business objects (BOs)
At my org we extensively use @Value.Immutable annotation from the Immutables library to generate Immutable classes (usually with builders) for our internal business objects (BOs). In our codebase I've seen both interfaces and abstract classes being…

y2k-shubham
- 10,183
- 11
- 55
- 131
-2
votes
2 answers
org immutables - no default constructor on abstract class
Using https://immutables.github.io/ I wonder if it is possible to have something like custom immutable abstract class inheriting from a class without a default constructor. In this example a sub of Spring's ApplicationEvent (and also take advantage…

Pwnstar
- 2,333
- 2
- 29
- 52