io.vertx.kafka.admin

## Class NewTopic

- java.lang.Object
- - io.vertx.kafka.admin.NewTopic

-     public class NewTopic
      extends Object

  A new topic to be created

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NewTopic()` Constructor
    `NewTopic(JsonObject json)` Constructor (from JSON representation)
    `NewTopic(String name, int numPartitions, short replicationFactor)` Constructor
    `NewTopic(String name, Map<Integer,List<Integer>> replicasAssignments)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Map<String,String>` | `getConfig()`
    `String` | `getName()`
    `int` | `getNumPartitions()`
    `Map<Integer,List<Integer>>` | `getReplicasAssignments()`
    `short` | `getReplicationFactor()`
    `NewTopic` | `setConfig(Map<String,String> config)` Set the configuration for the new topic or null if no configs ever specified
    `NewTopic` | `setName(String name)` Set the name of the topic to be created
    `NewTopic` | `setNumPartitions(int numPartitions)` Set the number of partitions for the new topic or -1 if a replica assignment has been specified
    `NewTopic` | `setReplicasAssignments(Map<Integer,List<Integer>> replicasAssignments)` Set a map from partition id to replica ids
    `NewTopic` | `setReplicationFactor(short replicationFactor)` Set the replication factor for the new topic or -1 if a replica assignment has been specified
    `JsonObject` | `toJson()` Convert object to JSON representation
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### NewTopic

          public NewTopic()

      Constructor

    - #### NewTopic

          public NewTopic(String name,
                          int numPartitions,
                          short replicationFactor)

      Constructor
      Parameters:
        `name` - the topic name
        `numPartitions` - number of partitions
        `replicationFactor` - replication factor

    - #### NewTopic

          public NewTopic(String name,
                          Map<Integer,List<Integer>> replicasAssignments)

      Constructor
      Parameters:
        `name` - the topic name
        `replicasAssignments` - a map from partition id to replica ids

    - #### NewTopic

          public NewTopic(JsonObject json)

      Constructor (from JSON representation)
      Parameters:
        `json` - JSON representation

  - ### Method Detail

    - #### getName

          public String getName()

      Returns:
        the name of the topic to be created

    - #### setName

          public NewTopic setName(String name)

      Set the name of the topic to be created
      Parameters:
        `name` - the name of the topic to be created
      Returns:
        current instance of the class to be fluent

    - #### getNumPartitions

          public int getNumPartitions()

      Returns:
        the number of partitions for the new topic or -1 if a replica assignment has been specified

    - #### setNumPartitions

          public NewTopic setNumPartitions(int numPartitions)

      Set the number of partitions for the new topic or -1 if a replica assignment has been specified
      Parameters:
        `numPartitions` - the number of partitions for the new topic or -1 if a replica assignment has been specified
      Returns:
        current instance of the class to be fluent

    - #### getReplicationFactor

          public short getReplicationFactor()

      Returns:
        the replication factor for the new topic or -1 if a replica assignment has been specified

    - #### setReplicationFactor

          public NewTopic setReplicationFactor(short replicationFactor)

      Set the replication factor for the new topic or -1 if a replica assignment has been specified
      Parameters:
        `replicationFactor` - the replication factor for the new topic or -1 if a replica assignment has been specified
      Returns:
        current instance of the class to be fluent

    - #### getReplicasAssignments

          public Map<Integer,List<Integer>> getReplicasAssignments()

      Returns:
        a map from partition id to replica ids

    - #### setReplicasAssignments

          public NewTopic setReplicasAssignments(Map<Integer,List<Integer>> replicasAssignments)

      Set a map from partition id to replica ids
      Parameters:
        `replicasAssignments` - a map from partition id to replica ids
      Returns:
        current instance of the class to be fluent

    - #### getConfig

          public Map<String,String> getConfig()

      Returns:
        the configuration for the new topic or null if no configs ever specified

    - #### setConfig

          public NewTopic setConfig(Map<String,String> config)

      Set the configuration for the new topic or null if no configs ever specified
      Parameters:
        `config` - the configuration for the new topic or null if no configs ever specified
      Returns:
        current instance of the class to be fluent

    - #### toJson

          public JsonObject toJson()

      Convert object to JSON representation
      Returns:
        JSON representation

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2021 Eclipse. All rights reserved.