I am +1 on "apply" as the name (much better than "config"!) But I really think 
the flavor with the boolean parameter is redundant. 

Andrus


> On Jul 8, 2024, at 6:29 AM, Jurgen Doll <jur...@ivoryemr.co.za> wrote:
> 
> Hi All
> 
> What about borrowing "apply" from Function/UnaryOperator ?
> Then we'll have the following API added to Expression:
> 
> /**
> * Apply the provided UnaryOperator function to the current Expression.
> */
> public Expression apply( UnaryOperator<Expression> op )
> {
>    return op.apply( this );
> }
> 
> And the same for ObjectSelect but passing a Consumer instead:
> 
> /**
> * Apply the provided Consumer to the current ObjectSelect.
> */
> public ObjectSelect<T> apply( Consumer<ObjectSelect<T>> op )
> {
>    op.accept( this );
>    return this;
> }
> 
> In addition I'd still very much like to have "apply" API that takes a boolean 
> parameter as well. For simple cases this will allow user code to be more 
> concise without the ternary pattern clutter.
> 
> Thoughts, tweaks, likes or objections ?
> 
> Regards
> Jurgen

Reply via email to