I'm using the Jackson library to transform the following JSON into a Java object.
{"name":"Agent/MetricsReported/count","begin":"2014-02-04T09:44:00Z","end":"2014-02-04T09:45:00Z","app":"","agent_id":, "average_exclusive_time":0.23999999463558197}
My problem is that all JSON fields are fixed, except the last one ( average_exclusive_time
). It can have another name according to a parameter passed in the request of a web service.
Is there a way to configure the Jackson library to map this last dynamic value to a field called value
or perhaps to Map
.
What I want to avoid is having to create a class for every possible variation of this last field that can take other names.