You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of v3.8, it is possible to use a Supplier as a Randomizer transparently thanks to a dynamic proxy created by random beans. However, this feature (introduced in #28) made the API verbose because we need to explicitly specify the type of the lambda expression when using EnhancedRandomBuilder#randomize. Here is an example:
This is due to the fact the EnhancedRandomBuilder#randomize is overloaded with both a Randomizer and a Supplier.
IMO, this explicit cast is verbose and can be avoided by letting the user adapts the supplier if any. RB would provide a static method to create the proxy. This simple inversion of roles makes the API and its usage less verbose without compromising the feature.
The text was updated successfully, but these errors were encountered:
As of v3.8, it is possible to use a
Supplier
as aRandomizer
transparently thanks to a dynamic proxy created by random beans. However, this feature (introduced in #28) made the API verbose because we need to explicitly specify the type of the lambda expression when usingEnhancedRandomBuilder#randomize
. Here is an example:This is due to the fact the
EnhancedRandomBuilder#randomize
is overloaded with both aRandomizer
and aSupplier
.IMO, this explicit cast is verbose and can be avoided by letting the user adapts the supplier if any. RB would provide a static method to create the proxy. This simple inversion of roles makes the API and its usage less verbose without compromising the feature.
The text was updated successfully, but these errors were encountered: