Use this tag for questions relating to the Immutables Library for Java.
Questions tagged [immutables-library]
99 questions
0
votes
1 answer
Javax validation are not carried to Immutable generated class
I'm using immutables.org library and want to add Javax annotation validation. But I noticed that the validations are not being carried to the generated class. I thought that immutables.org were compatible with validations annotations.
I have…

John
- 1,697
- 4
- 27
- 53
0
votes
1 answer
Mapstruct not selecting overloaded method for optional properties generated by Immutables
I'm using Immutables to generate some classes DTO classes, and Mapstruct to map JPA entities to DTOs. This works great, as long as the DTO has only required properties. If a property is not required (by making the accessor method return an Optional,…

Steen
- 311
- 1
- 3
- 11
0
votes
1 answer
Findbugs error - RV_RETURN_VALUE_IGNORED when using ImmutableSet.Builder
Findbugs throws warning for the following piece of code. Seems like a simple of Builder class to add items and construct at the end. Whats the issue here ?
public static Set convert(@NonNull final String id,
@NonNull final…

Anuj Kulkarni
- 2,261
- 5
- 32
- 42
0
votes
1 answer
Immutables no classes being generated eclipse
Been trying to set up the Immutables library but despite following the guide Eclipse doesn't seem to be generating any classes in the target/generated-sources/annotations folder
here's a screenshot of the java compiler -> Annotation Processing…

Mike Davies
- 487
- 5
- 14
0
votes
1 answer
Serializing ImmutableMap with Jackson
I am trying to serialize ImmutableMap using Jackson. The custom serialiser is written specifically for Dummy class. Default behaviour is okay for the rest.
It works fine for Dummy class but not for ImmutableMap object.
Serializer…

the_stack_over_flew
- 95
- 8
0
votes
0 answers
Java Immutables Polymorphism - how to make generated class extend another class?
I'm using the immutables library to create immutable objects from interfaces. However, I can't find a way to make generated classes extend one another in order to make them polymorphic.
Consider this…

curiousdev
- 626
- 8
- 24
0
votes
1 answer
MapStruct and Immutables
I am having trouble getting mapstruct and immutables to work.
@Value.Immutable
public abstract class FoobarValue {
public abstract Integer foo();
}
@Value.Immutable
public abstract class TargetFoo {
public abstract Integer…

ArunM
- 2,274
- 3
- 25
- 47
0
votes
0 answers
How to use java validation together with immutables.github.io
I'm using http://immutables.github.io in my SpringBoot project. I added Javax validation annotations in order to validate class but it did not work.
I tried to do this way:
@Value.Immutable
@JsonDeserialize(builder =…

Nasibulloh Yandashev
- 508
- 1
- 9
- 32
0
votes
0 answers
How to get micronaut generate OpenAPI schema properties for Value.Immutable classes?
I am using Value.Immutable classes as the rest api request/response. The generated OpenAPI doc does not show the properties of the immutable class. It looks like the OpenAPI generator does not understand these beans as there are no getters and…

M Perpe
- 39
- 1
- 4
0
votes
1 answer
Unable to deserialize using Jackson with Immutables: unrecog
I've a JSON in the following format:
{
"FileStatuses": {
"FileStatus": [{
"accessTime": 1479784299020,
"type": "FILE"
},
{
"accessTime": 1475421868510,
…

user310571
- 1
- 3
0
votes
2 answers
Unit test is failing while converting an entity to Immutable model object using Mapstruct
I am using MapStruct to convert a database entity to Immutable model object. So Immutable object doesn't have setters but Mapstruct requires setters when mapping objects. So I created an explicit builder using Immutable object builder to provides to…

slayer
- 393
- 1
- 5
- 19
0
votes
1 answer
Swagger requestbody example value empty
We are trying to set up springfox:swagger-ui. However, when creating the restcontroller with a post method using a Value.Immutable interface, the example is showing {} and the model is showing the interface name but nothing else.
I noticed that,…

Ronny176
- 265
- 1
- 4
- 13
0
votes
1 answer
Which is the best way to create an empty set in builder object
A class has a Set of String objects defined as its instance variable.
Step-1: I have a method which creates an object for this class, assign an empty set of String to the instance variable and then returns the object.
The method which receives it,…

adimoh
- 658
- 2
- 8
- 20
0
votes
1 answer
Deserialization exception with Immutables and Hibernate vladmihalcea jsonb type
I'm using Immutables and Hibernate Types to serialize an object as jsonb into PostgreSQL.
My entity is mapped like this:
@Entity
@Table(schema = "data", name = "event")
@TypeDef(name = "jsonb", typeClass = JsonBinaryType.class)
public class Event…

Thiago
- 883
- 11
- 20
0
votes
1 answer
immutable mongo some of required attributes are not set
I am using immutables to interact with MongoDB.
I am creating a very simple example below:-
@Mongo.Repository
@Value.Immutable
@Gson.TypeAdapters
@JsonDeserialize(as = ImmutablePerson.class)
@JsonSerialize(as = ImmutablePerson.class)
public…

Amar Dev
- 1,360
- 2
- 18
- 38