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