Best way to return status flag and message from a method in Java

后端 未结 17 1240
清酒与你
清酒与你 2020-12-25 12:55

I have a deceptively simple scenario, and I want a simple solution, but it\'s not obvious which is \"most correct\" or \"most Java\".

Let\'s say I have a small authe

17条回答
  •  星月不相逢
    2020-12-25 13:22

    You could return a Collection of error messages, empty indicating that there were no problems. This is a refinement of your third suggestion.

提交回复
热议问题