I like that distinction, Gary. For example, the withers in Lombok are used
for creating copies with the named property updated. A builder pattern
using the same builder instance would then make sense to use setter names
instead of wither names.

On 22 May 2017 at 10:54, Mikael Ståldal <mi...@apache.org> wrote:

> SocketAppender uses "with" like this:
>
> public B withSslConfiguration(final SslConfiguration sslConfiguration) {
>     this.sslConfiguration = sslConfiguration;
>     return asBuilder();
> }
>
> is that wrong?
>
>
> On 2017-05-22 17:50, Gary Gregory wrote:
>
>> I like "with" for methods that return a new instance and "set" for those
>> that do not.
>>
>> Since most if not all of our builders don't create new instances on setter
>> calls I would go with "set".
>>
>> 2c,
>> Gary
>>
>> Gary
>>
>> On May 22, 2017 8:36 AM, "Mikael Ståldal" <mi...@apache.org> wrote:
>>
>> What is the preferred naming convention for plugin builder setter methods?
>>> It is setXXX or withXXX? I see both being used in the code base.
>>>
>>> I wonder which to use for the upcoming HttpAppender (LOG4J2-1442).
>>>
>>>
>>>
>>>
>


-- 
Matt Sicker <boa...@gmail.com>

Reply via email to