You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bookkeeper.apache.org by "Ivan Kelly (JIRA)" <ji...@apache.org> on 2014/09/17 15:08:34 UTC

[jira] [Comment Edited] (BOOKKEEPER-782) Use builder pattern for Cookie

    [ https://issues.apache.org/jira/browse/BOOKKEEPER-782?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14137189#comment-14137189 ] 

Ivan Kelly edited comment on BOOKKEEPER-782 at 9/17/14 1:08 PM:
----------------------------------------------------------------

No no, I suggest you generateCookie as a static, but return the builder instead.

So
{code}
String instanceId = getInstanceId(zk);
Cookie.Builder builder = Cookie.generateCookie(conf);
if (null != instanceId) {
    builder.setInstanceId(instanceId);
}
Cookie masterCookie = builder.build();
{code}



was (Author: ikelly):
No no, I suggest you generateCookie as a static, but return the builder instead.

So
{quote}
String instanceId = getInstanceId(zk);
Cookie.Builder builder = Cookie.generateCookie(conf);
if (null != instanceId) {
    builder.setInstanceId(instanceId);
}
Cookie masterCookie = builder.build();
{quote}


> Use builder pattern for Cookie
> ------------------------------
>
>                 Key: BOOKKEEPER-782
>                 URL: https://issues.apache.org/jira/browse/BOOKKEEPER-782
>             Project: Bookkeeper
>          Issue Type: Sub-task
>          Components: bookkeeper-server
>            Reporter: Rakesh R
>            Assignee: Rakesh R
>             Fix For: 4.3.0
>
>         Attachments: BOOKKEEPER-782.patch, BOOKKEEPER-782.patch, BOOKKEEPER-782.patch, BOOKKEEPER-782.patch, BOOKKEEPER-782.patch
>
>
> It would be good to use builder pattern for Cookie, rather than modifying the fields in place.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)