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
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
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
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
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
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).