Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3943

ConfigDef should support a builder pattern.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      I catch myself always having to lookup the overloads for define. What about adding a builder pattern?

      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();
      

      Attachments

        Issue Links

          Activity

            People

              jcustenborder Jeremy Custenborder
              jcustenborder Jeremy Custenborder
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: