gestalt
gestalt copied to clipboard
Add field resolution strategy
Currently the ObjectDecoder, ProxyDecoder, RecordDecoder and DataClassDecoder all have the similar steps.
If field has value return value else if annotation has default return annotation default else if object has default return object default else if supports optional return empty optional else return null
instead of having a cascading if else in each of these, support a field resolution that can either return a result or an error. If there is a result, return it. Otherwise try next parameter resolution strategy.
This can be used in these 4 places.