gestalt icon indicating copy to clipboard operation
gestalt copied to clipboard

Add field resolution strategy

Open credmond-git opened this issue 1 year ago • 0 comments

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.

credmond-git avatar Apr 12 '24 17:04 credmond-git