We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValidatorSupport.getValidators() should return a List<Validator<? super T>> instead of List<Validator<T>>, because PECS.
ValidatorSupport.getValidators()
List<Validator<? super T>>
List<Validator<T>>
https://github.com/AppJars/commons-backend/blob/ca5a44fea72cec4a41f3b5c240bd8da590a43b0c/commons-model/src/main/java/com/appjars/saturn/validation/ValidationSupport.java#L27
(Picture courtesy: Andrey Tyukin CC-BY-SA)
For instance, if MyEntity implements HasFoo and FooValidator implements Validator<HasFoo>, then MyEntityService can implement getValidators() as:
MyEntity implements HasFoo
FooValidator implements Validator<HasFoo>
MyEntityService
getValidators()
public List<Validator<? super MyEntity>> getValidators() { return List.of(new FooValidator()); }
(which makes sense because FooValidator is able to validate any Foo, including my entity)
FooValidator
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ValidatorSupport.getValidators()
should return aList<Validator<? super T>>
instead ofList<Validator<T>>
, because PECS.https://github.com/AppJars/commons-backend/blob/ca5a44fea72cec4a41f3b5c240bd8da590a43b0c/commons-model/src/main/java/com/appjars/saturn/validation/ValidationSupport.java#L27
(Picture courtesy: Andrey Tyukin CC-BY-SA)
For instance, if
MyEntity implements HasFoo
andFooValidator implements Validator<HasFoo>
, thenMyEntityService
can implementgetValidators()
as:(which makes sense because
FooValidator
is able to validate any Foo, including my entity)The text was updated successfully, but these errors were encountered: