Skip to content
This repository has been archived by the owner on Aug 19, 2018. It is now read-only.

Ban method definitions with plain void as return type #220

Open
artem-v opened this issue Jul 27, 2018 · 1 comment
Open

Ban method definitions with plain void as return type #220

artem-v opened this issue Jul 27, 2018 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@artem-v
Copy link
Contributor

artem-v commented Jul 27, 2018

if (returnType.isAssignableFrom(Void.TYPE)) {
  throw new IllegalMethodDefinitionWeDontSupportThisException();
}

You can define:

  Mono<Void> funcVoidReactive();

You should not be allowed to define:

void funcNonReactive();

Motivation: it's hard to combine plain void functions, let's define convention that our service definitions has to be pure functions, i.e. must return somerhinhg , even if it's Mono. Why do that? For caring about api clients, about their ability to combine.

@artem-v artem-v added enhancement New feature or request question Further information is requested labels Jul 27, 2018
@artem-v
Copy link
Contributor Author

artem-v commented Jul 27, 2018

looping @ronenhamias

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant