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 <mi...@apache.org> 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 is more confusing than "wrong".
Gary
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).