Skip to content

Conversation

@tisla1080
Copy link
Contributor

  • For the BaseUpdateImperativeRestController call MonoResponseEntityCreator instead of CreateResponseEntityCreator since we usually return null or a response class when updating
  • create a NullServiceResponse class to be used for all cases where a null response is preferred as a possible return value.

Rather than return null directly, users can utilize this class and return NullServiceResponse.INSTANCE (which returns null) instead as it also implements BaseServiceResponse adhering to the generic parameter contract set in all our controllers.

DISCUSSION: Is there another name that would fit better than just NullServiceResponse? (keeping in mind our use case would be that we want to return null as a value?

@tisla1080 tisla1080 requested a review from a team as a code owner December 12, 2024 19:41
@tisla1080 tisla1080 requested a review from eaquin02 December 12, 2024 19:41
* NullServiceResponse.INSTANCE rather than just returning null directly as this class also extends {@code BaseServiceResponse}
* adhering to the prototype contracts.
*/
public class NullServiceResponse implements BaseServiceResponse {
Copy link
Collaborator

@guttff guttff Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rename this file to either EmptyServiceResponse or NoServiceResponse or better a name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we thought about it but if this class's INSTANCE method is returning back Null would it make sense to have EmptyServiceResponse.INSTANCE = null instead of NullServiceResponse.INSTANCE = null? if you think so then I'm good to change it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants