jw
07/28/2022, 3:52 PMreadJsonValue()
that will give you a Map
(for a JSON object) which you can query to determine the "shape" of the object. Then, you can delegate to the correct adapter which can parse that specific shape. So for your root object you would delegate to an adapter for a Time
or Sensor
object. Now the problem is fractal so you just repeat yourself. You register a custom adapter for Sensor
which does the same thing (reads the json a "value" and inspects it) to create either an AlwaysCondition
or a ThresholdCondition
.