-
Notifications
You must be signed in to change notification settings - Fork 52
Support for RangeSet
missing
#90
Comments
@mittalnanu um, what? |
Sorry, should have been more elaborate. //Code 1
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new GuavaModule());
System.out.println(mapper.writeValueAsString(Range.open(1,23))); //Output 1 //Code 2 RangeSet<Integer> rangeSet= TreeRangeSet.create();
rangeSet.add(Range.open(1,5));
rangeSet.add(Range.openClosed(7, 1000));
ObjectMapper mapper = new ObjectMapper();
mapper.registerModule(new GuavaModule());
System.out.println(mapper.writeValueAsString(rangeSet)); //Output 2 My question is RangeSet, doesn't seem to be supported out of the box. Is there something I am missing or need to write own Jackson Serializer / Deserializer ? |
Module supports a subset of Guava datatypes, based on what users have needed, and contributed handlers for. Due to sheer size of Guava (very much monolithic collection of tons of things), coverage is not complete. I do know that |
RangeSet
missing
Thanks for the revert @cowtowncoder //Input //Output |
@mittalnanu If |
Yes so , rangeSet.asRanges() returns a Set and it works automatically. So I think that is a neat workaround. Do you see any scenario where a specific serializer is needed given I can get Set from RangeSet ? |
@mittalnanu Right if and when you can get a regular |
Are there any alternatives, I don't see any utility in the current module?
The text was updated successfully, but these errors were encountered: