Closed jeusdi closed 7 months ago
I don't understand what you are trying to accomplish. The code presented doesn't work?
Code above works.
My question is about how could I get custom Validation<MyError, T>
instead of always Validation<ConstraintViolation, T>
or Validated<T>
...
I mean, ArgumentsValidatorBuilder.of(......).build().validate(...)
always returns an Validated<T>
akka Validation<ConstraintViolation, T>
. I like to get Validation<MyError, T>
instead of.
That's not the intended usage.
As a general utility, I have created Validation
interface in am.ik.yavi.fn
package, but am.ik.yavi.core
package uses the specific Validated
type.
I see that all
Validated
orValidation
objects that aValidator
returns, have aConstraintViolation
as declaredE
type.I mean, all validation errors of
validate
object are of typeConstraintViolation
.I'd like to construct custom
Validation
structures instead ofConstraintViolation
by default. For example:How could I get this using above fluent syntax approach?
Another question: Is there any way to "combine" or merge a stream of
Validation<DomainReferenceFailure>
? or I need to combine them one by one?