You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jeremy Custenborder (JIRA)" <ji...@apache.org> on 2016/07/09 22:55:10 UTC

[jira] [Created] (KAFKA-3943) ConfigDef should support a builder pattern.

Jeremy Custenborder created KAFKA-3943:
------------------------------------------

             Summary: 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)