Re: Plugin builder setters

2017-05-22 Thread Mikael Ståldal
Then I keep it as "set" in HttpAppender. On 2017-05-22 20:26, Gary Gregory wrote: On Mon, May 22, 2017 at 8:54 AM, Mikael Ståldal wrote: SocketAppender uses "with" like this: public B withSslConfiguration(final SslConfiguration sslConfiguration) { this.sslConfiguration = sslConfiguratio

Re: Plugin builder setters

2017-05-22 Thread Gary Gregory
On Mon, May 22, 2017 at 8:54 AM, Mikael Ståldal wrote: > SocketAppender uses "with" like this: > > public B withSslConfiguration(final SslConfiguration sslConfiguration) { > this.sslConfiguration = sslConfiguration; > return asBuilder(); > } > > is that wrong? > In my mind, yes, but it i

Re: Plugin builder setters

2017-05-22 Thread Matt Sicker
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 wrote: > So

Re: Plugin builder setters

2017-05-22 Thread Mikael Ståldal
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 an

Re: Plugin builder setters

2017-05-22 Thread Gary Gregory
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" wrote: > What is the preferred naming conventio

Plugin builder setters

2017-05-22 Thread Mikael Ståldal
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).