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

ASF GitHub Bot commented on KAFKA-3943:
---------------------------------------

GitHub user jcustenborder opened a pull request:

    https://github.com/apache/kafka/pull/1602

    KAFKA-3943 - ConfigDef with Builder pattern

    Added Builder class and define() method with no arguments. Added testcase 
validating the ConfigDef using the current implementation against the new 
builder implementation.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jcustenborder/kafka KAFKA-3943

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/1602.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1602
    
----
commit de7873c57a382b9b8976e50fea1c2842ad3aa961
Author: Jeremy Custenborder <jcustenbor...@gmail.com>
Date:   2016-07-09T23:33:40Z

    Added Builder class and define() method with no arguments. Added test case 
validating the ConfigDef using the current implementation against the new 
builder implementation.

----


> ConfigDef should support a builder pattern.
> -------------------------------------------
>
>                 Key: KAFKA-3943
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3943
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Jeremy Custenborder
>            Assignee: Jeremy Custenborder
>            Priority: Minor
>
> I catch myself always having to lookup the overloads for define. What about 
> adding a builder pattern?
> {code}
> ConfigDef def = new ConfigDef()
>     
> .define().name("a").type(Type.INT).defaultValue(5).validator(Range.between(0, 
> 14)).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("b").type(Type.LONG).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("c").type(Type.STRING).defaultValue("hello").importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("d").type(Type.LIST).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("e").type(Type.DOUBLE).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("f").type(Type.CLASS).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("g").type(Type.BOOLEAN).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("h").type(Type.BOOLEAN).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("i").type(Type.BOOLEAN).importance(Importance.HIGH).documentation("docs").build()
>     
> .define().name("j").type(Type.PASSWORD).importance(Importance.HIGH).documentation("docs").build();
> {code}



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

Reply via email to